MCPcopy Create free account
hub / github.com/SAP/ui5-builder / getStringValue

Function getStringValue

lib/lbt/utils/ASTUtils.js:22–30  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

20}
21
22export function getStringValue(node) {
23 if (isLiteral(node)) {
24 return node.value;
25 } else if (isTemplateLiteralWithoutExpression(node)) {
26 return node?.quasis?.[0]?.value?.cooked;
27 } else {
28 return undefined;
29 }
30}
31
32export function isLiteral(node) {
33 return node && node.type === Syntax.Literal && typeof node.value === "string";

Callers 12

onDeclareMethod · 0.90
onDefineMethod · 0.90
onJQuerySapRequireMethod · 0.90
onSapUiRequireSyncMethod · 0.90
onSapUiPredefineMethod · 0.90
constructorMethod · 0.90
isStringFunction · 0.85
getStringArrayFunction · 0.85

Calls 2

isLiteralFunction · 0.85

Tested by

no test coverage detected