| | |
| | | } |
| | | |
| | | /** |
| | | * Gets the compile-time value of the expression |
| | | * As compile time value. |
| | | * @returns {undefined | null | string | number | boolean | RegExp | EXPECTED_ANY[] | bigint} the javascript value |
| | | */ |
| | | asCompileTimeValue() { |
| | |
| | | if (this.isBigInt()) return `${this.bigint}`; |
| | | if (this.isRegExp()) return `${this.regExp}`; |
| | | if (this.isArray()) { |
| | | /** @type {string[]} */ |
| | | const array = []; |
| | | for (const item of /** @type {BasicEvaluatedExpression[]} */ ( |
| | | this.items |
| | |
| | | } |
| | | |
| | | /** |
| | | * Updates string using the provided string. |
| | | * @param {string} string value |
| | | * @returns {BasicEvaluatedExpression} basic evaluated expression |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Adds options to a conditional expression. |
| | | * Adds the provided basic evaluated expression to the basic evaluated expression. |
| | | * @param {BasicEvaluatedExpression[]} options optional (consequent/alternate) expressions to be added |
| | | * @returns {this} this |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns is valid flags. |
| | | * @param {string} flags regexp flags |
| | | * @returns {boolean} is valid flags |
| | | */ |