forceTransformedStrings option

This commit is contained in:
sanex
2020-09-24 00:39:07 +03:00
parent 8fdb22b31d
commit a5d7f7418c
40 changed files with 658 additions and 145 deletions
+8
View File
@@ -3,6 +3,14 @@ import * as ESTree from 'estree';
import { NodeGuards } from './NodeGuards';
export class NodeLiteralUtils {
/**
* @param {Literal} literalNode
* @returns {literalNode is (SimpleLiteral & {value: string})}
*/
public static isStringLiteralNode (literalNode: ESTree.Literal): literalNode is ESTree.Literal & {value: string} {
return typeof literalNode.value === 'string';
}
/**
* @param {Literal} literalNode
* @param {Node} parentNode
+8
View File
@@ -20,6 +20,14 @@ export class NodeMetadata {
: undefined;
}
/**
* @param {Node} node
* @returns {boolean}
*/
public static isForceObfuscatedNode (node: ESTree.Node): boolean {
return NodeMetadata.get(node, 'forceObfuscatedNode') === true;
}
/**
* @param {Node} node
* @returns {boolean}