Comparing version 1.0.2 to 1.0.3
@@ -14,3 +14,3 @@ /*jshint node:true, laxcomma:true */ | ||
exports.sentences = function(text, options) { | ||
if (text.length === 0) | ||
if (!text || typeof text === "undefined" || text.length === 0) | ||
return []; | ||
@@ -17,0 +17,0 @@ |
{ | ||
"name": "sbd", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Split text into sentences with Sentence Boundary Detection (SBD).", | ||
@@ -26,3 +26,3 @@ "main": "lib/tokenizer.js", | ||
"dependencies": { | ||
"sanitize-html": "^1.4.3" | ||
"sanitize-html": "^1.11.2" | ||
}, | ||
@@ -29,0 +29,0 @@ "browser": { |
@@ -19,2 +19,10 @@ /*jshint node:true, laxcomma:true */ | ||
describe('undefined', function () { | ||
var sentences = tokenizer.sentences(); | ||
it('should not get a sentence', function () { | ||
assert.equal(sentences.length, 0); | ||
}); | ||
}); | ||
describe('symbols only', function () { | ||
@@ -21,0 +29,0 @@ var entry = "^&%(*&"; |
31343
643
Updatedsanitize-html@^1.11.2