aboutsummaryrefslogtreecommitdiff
path: root/lib/document-matchers.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/document-matchers.js')
-rw-r--r--lib/document-matchers.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/document-matchers.js b/lib/document-matchers.js
index 820d6c2..58b3204 100644
--- a/lib/document-matchers.js
+++ b/lib/document-matchers.js
@@ -22,17 +22,19 @@ Matcher.prototype.matches = function(element) {
}
Matcher.prototype.orderedList = function(levelIndex) {
- this._listIndex = levelIndex;
- this._listIsOrdered = true;
- return this;
+ return this.list({isOrdered: true, levelIndex: levelIndex});
}
Matcher.prototype.unorderedList = function(levelIndex) {
- this._listIndex = levelIndex;
- this._listIsOrdered = false;
- return this;
+ return this.list({isOrdered: false, levelIndex: levelIndex});
}
+Matcher.prototype.list = function(options) {
+ this._listIndex = options.levelIndex;
+ this._listIsOrdered = options.isOrdered;
+ return this;
+};
+
function isList(element, levelIndex, isOrdered) {
return element.numbering &&
element.numbering.level == levelIndex &&