@types/jexl
Advanced tools
| /** | ||
| * Jexl's abstract syntax tree | ||
| */ | ||
| type Ast = | ||
| | { type: 'UnaryExpression'; operator: string; right: Ast } | ||
| | { type: 'BinaryExpression'; operator: string; left: Ast; right: Ast } | ||
| | { type: 'ConditionalExpression'; test: Ast; consequent: Ast; alternate: Ast } | ||
| | { type: 'FilterExpression'; relative: boolean; expr: Ast; subject: Ast } | ||
| | { type: 'Literal'; value: string | number | boolean } | ||
| | { type: 'ArrayLiteral'; value: Ast[] } | ||
| | { type: 'ObjectLiteral'; value: { [key: string]: Ast } } | ||
| | { type: 'Identifier'; value: string; from?: Ast; relative?: boolean } | ||
| | { type: 'FunctionCall'; name: string; pool: 'functions' | 'transforms'; args: Ast[] }; | ||
| export default Ast; |
| export type Element = | ||
| | { type: 'dot' } | ||
| | { type: 'openBracket' } | ||
| | { type: 'closeBracket' } | ||
| | { type: 'pipe' } | ||
| | { type: 'openCurl' } | ||
| | { type: 'closeCurl' } | ||
| | { type: 'colon' } | ||
| | { type: 'comma' } | ||
| | { type: 'openParen' } | ||
| | { type: 'closeParen' } | ||
| | { type: 'question' } | ||
| | { | ||
| type: 'binaryOp'; | ||
| precedence: number; | ||
| eval?: (...args: unknown[]) => unknown; | ||
| evalOnDemand?: (...args: unknown[]) => unknown; | ||
| }; | ||
| export default interface Grammar { | ||
| elements: { [symbol: string]: Element }; | ||
| functions: { [name: string]: (...args: unknown[]) => unknown }; | ||
| transform: { [name: string]: (...args: [unknown, ...unknown[]]) => unknown }; | ||
| } |
@@ -0,1 +1,3 @@ | ||
| import Ast from './Ast'; | ||
| export interface Context { | ||
@@ -33,5 +35,9 @@ [key: string]: any; | ||
| _getAst(): any; | ||
| /** | ||
| * Get the abstract syntax tree that represents the compiled expression | ||
| * @returns the abstract syntax tree | ||
| */ | ||
| _getAst(): Ast; | ||
| } | ||
| export default Expression; |
+8
-2
@@ -8,2 +8,3 @@ // Type definitions for jexl 2.3 | ||
| import Expression, { Context } from './Expression'; | ||
| import Grammar from './Grammar'; | ||
@@ -89,3 +90,3 @@ type TransformFunction = (value: any, ...args: any[]) => any; | ||
| /** | ||
| * Syntatic sugar for calling {@link #addFunction} repeatedly. This function | ||
| * Syntactic sugar for calling {@link #addFunction} repeatedly. This function | ||
| * accepts a map of one or more expression function names to their javascript | ||
@@ -146,2 +147,7 @@ * function counterpart. | ||
| removeOp(operator: string): void; | ||
| /** | ||
| * The grammar used to compile the expression. | ||
| */ | ||
| _grammar: Grammar; | ||
| } | ||
@@ -152,3 +158,3 @@ | ||
| * evaluating basic to complex expression strings, combined with advanced | ||
| * xpath-like drilldown into native Javascript objects. | ||
| * xpath-like drill down into native Javascript objects. | ||
| */ | ||
@@ -155,0 +161,0 @@ declare class BuildableJexl extends Jexl { |
| { | ||
| "name": "@types/jexl", | ||
| "version": "2.3.0", | ||
| "version": "2.3.1", | ||
| "description": "TypeScript definitions for jexl", | ||
@@ -23,4 +23,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jexl", | ||
| "dependencies": {}, | ||
| "typesPublisherContentHash": "8967824a810a8099b473353bc98dbfa8992d81b2a64077d3fdd02dd46488baa1", | ||
| "typeScriptVersion": "3.7" | ||
| "typesPublisherContentHash": "8c86725e68cadc24a4469fac98b0191d0687d27b956a07455e09c3b3c2861f30", | ||
| "typeScriptVersion": "4.0" | ||
| } |
+1
-1
@@ -11,3 +11,3 @@ # Installation | ||
| ### Additional Details | ||
| * Last updated: Wed, 15 Sep 2021 21:01:46 GMT | ||
| * Last updated: Thu, 07 Jul 2022 21:02:20 GMT | ||
| * Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
11659
16.52%7
40%213
28.31%