word-break
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

word-break

word-break util using a given dictionary

TypeScript

import wordBreak from "word-break";
 
test("wordBreak", () => {
  const input = "ilikesamsung";
  const dict = ["samsung", "like", "i"];
  const list = wordBreak(input, dict);
  expect(list.join("|")).toBe("i|like|samsung");
});

Package Sidebar

Install

npm i word-break

Weekly Downloads

2

Version

0.0.5

License

MIT

Unpacked Size

3.58 kB

Total Files

6

Last publish

Collaborators

  • pakornsak