Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public static literalNode (value: boolean | number | string, raw?: string): ESTree.Literal {
raw = raw !== undefined ? raw : `'${value}'`;
return {
type: NodeType.Literal,
value,
raw,
'x-verbatim-property': {
content: raw,
precedence: escodegen.Precedence.Primary
},
metadata: { ignoredNode: false }
};
}