@kilterset/auth0-actions-testing
Version:
Test and develop Auth0 Actions or Okta CIC Actions locally.
15 lines (12 loc) • 359 B
text/typescript
import * as ts from "typescript";
export function requires(node: ts.Node) {
if (ts.isCallExpression(node)) {
const expression = node.expression;
if (ts.isIdentifier(expression) && expression.text === "require") {
const firstArg = node.arguments[0];
if (ts.isStringLiteral(firstArg)) {
return firstArg.text;
}
}
}
}