Comparing version 2.0.1 to 2.0.2
@@ -7,3 +7,3 @@ import { NodeAST } from "."; | ||
query(query: string, ast: NodeAST): any[]; | ||
token(token: OptionNode | ProgramNode | OptionWithArgNode | ArgumentNode | OperatorNode | AssignmentNode | PipeNode | SudoNode | ReservedWordNode | RedirectNode | WordNode | OperandNode): any; | ||
token(token: OptionNode | ProgramNode | OptionWithArgNode | ArgumentNode | OperatorNode | AssignmentNode | PipeNode | SudoNode | ReservedWordNode | RedirectNode | WordNode | OperandNode, fromPropName?: string): any; | ||
private inRange; | ||
@@ -10,0 +10,0 @@ } |
@@ -45,6 +45,10 @@ "use strict"; | ||
} | ||
token(token) { | ||
let decoratedString = ""; | ||
decoratedString = this.decorators[token.kind](token); | ||
return decoratedString; | ||
token(token, fromPropName) { | ||
try { | ||
const decoratedString = this.decorators[token.kind](token, fromPropName); | ||
return decoratedString; | ||
} | ||
catch (err) { | ||
throw err; | ||
} | ||
} | ||
@@ -51,0 +55,0 @@ inRange(pos, range) { |
{ | ||
"name": "kmdr-ast", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Traverse the AST of an explanation by kmdr", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -79,9 +79,12 @@ import AST, { NodeAST } from "."; | ||
| WordNode | ||
| OperandNode | ||
| OperandNode, | ||
fromPropName?: string | ||
): any { | ||
let decoratedString: string = ""; | ||
try { | ||
const decoratedString = this.decorators[token.kind](token, fromPropName); | ||
decoratedString = this.decorators[token.kind](token); | ||
return decoratedString; | ||
return decoratedString; | ||
} catch (err) { | ||
throw err; | ||
} | ||
} | ||
@@ -88,0 +91,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
398075
3805