diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-05-03 21:27:00 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-05-03 21:27:00 +0100 |
| commit | ce01e3ec266ca3cbd96832766174e49337db98f8 (patch) | |
| tree | 60a6bec29909354bd95ecac7319f94f9bbde1d1e /lib/document-matchers.js | |
| parent | 23438dd97f93b86115cc4196c88d12e5168acbd5 (diff) | |
Replace paragraphStyleMap with more general styleMap
Diffstat (limited to 'lib/document-matchers.js')
| -rw-r--r-- | lib/document-matchers.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/document-matchers.js b/lib/document-matchers.js new file mode 100644 index 0000000..6a35b51 --- /dev/null +++ b/lib/document-matchers.js @@ -0,0 +1,17 @@ +exports.paragraph = paragraph; +exports.run = run; + + +function paragraph(styleName) { + return matcher("paragraph", styleName); +} + +function run(styleName) { + return matcher("run", styleName); +} + +function matcher(elementType, styleName) { + return function(element) { + return element.type === elementType && element.styleName === styleName; + }; +} |
