diff --git a/src/Document.js b/src/Document.js index 9b170a5..c8cb540 100644 --- a/src/Document.js +++ b/src/Document.js @@ -65,6 +65,8 @@ } count(xpath) { + if (typeof xpath !== 'string') throw new Error('xpath must be a string.'); + return this.get(`count(${xpath})`); }