diff options
author | Determinant <ted.sybil@gmail.com> | 2019-02-01 16:05:33 -0500 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2019-02-01 16:05:33 -0500 |
commit | 8b24b7bf2409549a5714fac32d52efb05d7d6621 (patch) | |
tree | debf31cd62019193e3b6396011a6c6589532dbc4 /src/pattern.js | |
parent | ec404a971bca523dde755687bad7999f55af1c65 (diff) |
maintain data store in background
Diffstat (limited to 'src/pattern.js')
-rw-r--r-- | src/pattern.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pattern.js b/src/pattern.js index ad94253..c7dafbd 100644 --- a/src/pattern.js +++ b/src/pattern.js @@ -10,6 +10,7 @@ export class Pattern { get isEmpty() { return this.label === null; } static emptyPattern = () => new Pattern(0, true, '', null); static anyPattern = () => new Pattern('any', true, '.*', 'Any'); + static revive = obj => new Pattern(obj.id, obj.isRegex, obj.value, obj.label); } export class PatternEntry { @@ -21,4 +22,7 @@ export class PatternEntry { } static defaultPatternEntry = (idx) => new PatternEntry('', idx, Pattern.emptyPattern(), Pattern.anyPattern()); + static revive = obj => new PatternEntry( + obj.name, obj.idx, + Pattern.revive(obj.cal), Pattern.revive(obj.event)); } |