PromucFlow_constructor/app/rts/src/services/AstService.ts
Ayangade Adeoluwa b3c4f7c392
feat: AST apis for parsing script and returning identifiers (#16252)
* rts configurations for ast

* update shared dependencies.json for shared ast module

* feat: api for script to identifiers

* fix: typo for identifiers

* feat: api for multiple scripts to get identifiers

* fix: rts config, apis for ast

* fix: removed unnecessary changes for ast modules

* fix: docker image for rts including ast shared module, rts file alias ref

* fix: added comments in build.sh file

Co-authored-by: Aman Agarwal <aman@appsmith.com>
2022-09-12 14:45:47 +05:30

22 lines
443 B
TypeScript

import { extractIdentifiersFromCode } from "@shared/ast";
export default class AstService {
static async getIdentifiersFromScript(
script,
evalVersion
): Promise<any> {
return new Promise((resolve, reject) => {
try {
const extractions = extractIdentifiersFromCode(
script,
evalVersion
);
resolve(extractions);
} catch (err) {
reject(err);
}
});
}
}