Comparing version 3.3.0 to 3.3.1
@@ -169,2 +169,4 @@ "use strict"; | ||
return this.decorators.relationalOperator(text, definition); | ||
case "argument": | ||
return this.decorators.argument(text, definition); | ||
case "command": | ||
@@ -171,0 +173,0 @@ return this.decorators.command(text); |
@@ -25,2 +25,3 @@ import { ArgumentSchema, OptionSchema, ProgramSchema, SubcommandSchema } from "kmdr-parser"; | ||
export interface Decorators<T extends Element | Text | string> { | ||
argument(text: string, node?: Node, definition?: NodeDefinition): T; | ||
arithmeticOperator(text: string, node?: Node, definition?: NodeDefinition): T; | ||
@@ -27,0 +28,0 @@ backtick(text: string, node?: Node, definition?: NodeDefinition): T; |
{ | ||
"name": "kmdr-ast", | ||
"version": "3.3.0", | ||
"version": "3.3.1", | ||
"description": "Traverse the AST of an explanation by kmdr", | ||
@@ -26,4 +26,3 @@ "main": "dist/index.js", | ||
"build": "tsc", | ||
"test": "jest --verbose", | ||
"publish": "yarn run build && np --no-tests" | ||
"test": "jest --verbose" | ||
}, | ||
@@ -30,0 +29,0 @@ "jest": { |
@@ -234,2 +234,4 @@ import { ASTNode } from "."; | ||
return this.decorators.relationalOperator(text, definition); | ||
case "argument": | ||
return this.decorators.argument(text, definition); | ||
case "command": | ||
@@ -236,0 +238,0 @@ return this.decorators.command(text); |
@@ -34,2 +34,3 @@ import { | ||
export interface Decorators<T extends Element | Text | string> { | ||
argument(text: string, node?: Node, definition?: NodeDefinition): T; | ||
arithmeticOperator(text: string, node?: Node, definition?: NodeDefinition): T; | ||
@@ -36,0 +37,0 @@ backtick(text: string, node?: Node, definition?: NodeDefinition): T; |
import { Decorators, Node, NodeDefinition } from "../src/interfaces"; | ||
export default class ConsoleDecorators implements Decorators<string> { | ||
public argument(text: string, node: Node, definition?: NodeDefinition) { | ||
return `${text}`; | ||
} | ||
public arithmeticOperator( | ||
@@ -5,0 +9,0 @@ text: string, |
Sorry, the diff of this file is not supported yet
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
738365
5545