Socket
Socket
Sign inDemoInstall

fast-levenshtein

Package Overview
Dependencies
0
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 2.0.1

8

levenshtein.js

@@ -5,5 +5,4 @@ (function() {

// language-sensitive collator
var collator = Intl.Collator("generic", { sensitivity: "base" });
var collator = (typeof Intl !== undefined && typeof Intl.Collator !== undefined) ? Intl.Collator("generic", { sensitivity: "base" }) : null;
// arrays to re-use

@@ -13,3 +12,2 @@ var prevRow = [],

/**

@@ -25,7 +23,7 @@ * Based on the algorithm at http://en.wikipedia.org/wiki/Levenshtein_distance.

* @param [options] Additional options.
* @param [options.useCollator] Use `Intl.Collator` for more locale-sensitive string comparison.
* @param [options.useCollator] Use `Intl.Collator` for locale-sensitive string comparison.
* @return Integer the levenshtein distance (0 and above).
*/
get: function(str1, str2, options) {
var useCollator = (options && options.useCollator);
var useCollator = (options && collator && options.useCollator);

@@ -32,0 +30,0 @@ var str1Len = str1.length,

{
"name": "fast-levenshtein",
"version": "2.0.0",
"version": "2.0.1",
"description": "Efficient implementation of Levenshtein algorithm with asynchronous callback support",

@@ -5,0 +5,0 @@ "main": "levenshtein.js",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc