Comparing version 0.0.3 to 0.0.4
@@ -13,3 +13,3 @@ function wordBreak(s, dict, longestWordLength) { | ||
const end = i === s.length; | ||
const words = !end ? wordBreak(s.substring(i), dict) : []; | ||
const words = !end ? wordBreak(s.substring(i), dict, max) : []; | ||
ret.push(...words); | ||
@@ -16,0 +16,0 @@ return ret; |
{ | ||
"name": "word-break", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "word-break util for npl", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -37,2 +37,9 @@ "use strict"; | ||
}); | ||
it("should use longestWordLength if defined", () => { | ||
const dict2 = ["samsung", "like", "sung", "sam", "i"]; | ||
expect(wordBreak("ilikesamsungsamsung", dict2, 4).join("|")).toBe( | ||
"i|like|sam|sung|sam|sung" | ||
); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3546
64