@tv2media/command-transpiler
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -7,3 +7,4 @@ import { Modifiable } from './modifiable'; | ||
private pattern; | ||
constructor(raw: string); | ||
private caseSensitive; | ||
constructor(raw: string, caseSensitive?: boolean); | ||
/** | ||
@@ -10,0 +11,0 @@ * @desc Tries to match the pattern on an input. |
@@ -9,6 +9,7 @@ "use strict"; | ||
class Pattern extends modifiable_1.Modifiable { | ||
constructor(raw) { | ||
constructor(raw, caseSensitive = true) { | ||
super(raw); | ||
this.raw = `^${this.raw}$`; | ||
this.pattern = null; | ||
this.caseSensitive = caseSensitive; | ||
} | ||
@@ -22,3 +23,3 @@ /** | ||
if (this.pattern === null) { | ||
this.pattern = new RegExp(this.raw); | ||
this.pattern = new RegExp(this.raw, this.caseSensitive ? '' : 'i'); | ||
} | ||
@@ -25,0 +26,0 @@ // Match |
{ | ||
"name": "@tv2media/command-transpiler", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Transpiles commands from one protocol to another.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
25249
650