@tv2media/command-transpiler
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -6,3 +6,6 @@ import { Rules } from './rules'; | ||
constructor(rules?: Rules, modifiers?: ModifierDomain); | ||
transpile(input: string): string; | ||
transpile(input: string): { | ||
line: number; | ||
result: string; | ||
}; | ||
} |
@@ -11,6 +11,6 @@ "use strict"; | ||
transpile(input) { | ||
for (const rule of this.rules) { | ||
for (const [line, rule] of this.rules.entries()) { | ||
const result = rule.match(input); | ||
if (result !== null) { | ||
return rule.fill(result); | ||
return { line, result: rule.fill(result) }; | ||
} | ||
@@ -17,0 +17,0 @@ } |
{ | ||
"name": "@tv2media/command-transpiler", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Transpiles commands from one protocol to another.", | ||
"main": "lib/index.js", | ||
"types": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"author": { | ||
@@ -8,0 +8,0 @@ "name": "Anders Frederik Jørgensen", |
@@ -9,3 +9,3 @@ # Command Transpiler | ||
Pattern: `ADD #{ number : amount } ` | ||
Pattern: `ADD #{ number : amount }` | ||
Template: `PLUS #{ amount }` | ||
@@ -12,0 +12,0 @@ Example: `ADD 5` => `PLUS 5` |
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
24979
644