diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/styles/document-matchers.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/styles/document-matchers.js b/lib/styles/document-matchers.js index 38ac049..3f7fbdd 100644 --- a/lib/styles/document-matchers.js +++ b/lib/styles/document-matchers.js @@ -6,6 +6,7 @@ exports.underline = new Matcher("underline"); exports.strikethrough = new Matcher("strikethrough"); exports.commentReference = new Matcher("commentReference"); exports.equalTo = equalTo; +exports.startsWith = startsWith; function paragraph(options) { @@ -42,11 +43,22 @@ function isList(element, levelIndex, isOrdered) { function equalTo(value) { return { - operator: equals, + operator: operatorEqualTo, operand: value }; } -function equals(first, second) { +function startsWith(value) { + return { + operator: operatorStartsWith, + operand: value + }; +} + +function operatorEqualTo(first, second) { return first.toUpperCase() === second.toUpperCase(); } + +function operatorStartsWith(first, second) { + return second.toUpperCase().indexOf(first.toUpperCase()) === 0; +} |
