Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

word-break

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

word-break - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

index.js

@@ -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"
);
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc