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 1.0.4 to 1.0.5

2

bower.json
{
"name": "fast-levenshtein",
"version": "1.0.3",
"version": "1.0.5",
"homepage": "https://github.com/hiddentao/fast-levenshtein",

@@ -5,0 +5,0 @@ "authors": [

@@ -45,2 +45,3 @@ module.exports = function(grunt) {

"node": true,
"worker": true,

@@ -47,0 +48,0 @@ "predef": [

@@ -179,4 +179,6 @@ (function() {

if (typeof define !== "undefined" && define !== null && define.amd) {
if(typeof self !== "undefined"){
self.Levenshtein = Levenshtein;
}
else if (typeof define !== "undefined" && define !== null && define.amd) {
define(function() {

@@ -183,0 +185,0 @@ return Levenshtein;

@@ -1,2 +0,2 @@

/*! fast-levenshtein 2014-09-15. Copyright Ramesh Nair <ram@hiddentao.com> (http://www.hiddentao.com/) */
(function(){"use strict";var e=function(e){for(var n=Array.prototype.slice.call(arguments,1),r=0;n.length>r;++r){var t=n[r];for(var l in t)t.hasOwnProperty(l)&&(e[l]=t[l])}return e},n={get:function(e,n){if(e===n)return 0;if(0===e.length)return n.length;if(0===n.length)return e.length;var r,t,l,u,f,o=Array(n.length+1);for(l=0;o.length>l;++l)o[l]=l;for(l=0;e.length>l;++l){for(t=l+1,u=0;n.length>u;++u)r=t,t=o[u]+(e.charAt(l)===n.charAt(u)?0:1),f=r+1,t>f&&(t=f),f=o[u+1]+1,t>f&&(t=f),o[u]=r;o[u]=t}return t},getAsync:function(n,r,t,l){if(l=e({},{progress:null},l),n===r)return t(null,0);if(0===n.length)return t(null,r.length);if(0===r.length)return t(null,n.length);var u,f,o,i,a,g,h,c=Array(r.length+1);for(o=0;c.length>o;++o)c[o]=o;f=1,o=0,i=-1;var d=function(){for(g=(new Date).valueOf(),h=g;1e3>h-g;){if(r.length<=++i){if(c[i]=f,n.length<=++o)return t(null,f);f=o+1,i=0}u=f,f=c[i]+(n.charAt(o)===r.charAt(i)?0:1),a=u+1,f>a&&(f=a),a=c[i+1]+1,f>a&&(f=a),c[i]=u,h=(new Date).valueOf()}if(null!==l.progress)try{l.progress.call(null,100*o/n.length)}catch(e){return t("Progress callback: "+(""+e))}setTimeout(d(),0)};d()}};"undefined"!=typeof define&&null!==define&&define.amd?define(function(){return n}):"undefined"!=typeof module&&null!==module?module.exports=n:"undefined"!=typeof window&&null!==window&&(window.Levenshtein=n)})();
/*! fast-levenshtein 2014-12-06. Copyright Ramesh Nair <ram@hiddentao.com> (http://www.hiddentao.com/) */
!function(){"use strict";var a=function(a){for(var b=Array.prototype.slice.call(arguments,1),c=0;c<b.length;++c){var d=b[c];for(var e in d)d.hasOwnProperty(e)&&(a[e]=d[e])}return a},b={get:function(a,b){if(a===b)return 0;if(0===a.length)return b.length;if(0===b.length)return a.length;var c,d,e,f,g,h=new Array(b.length+1);for(e=0;e<h.length;++e)h[e]=e;for(e=0;e<a.length;++e){for(d=e+1,f=0;f<b.length;++f)c=d,d=h[f]+(a.charAt(e)===b.charAt(f)?0:1),g=c+1,d>g&&(d=g),g=h[f+1]+1,d>g&&(d=g),h[f]=c;h[f]=d}return d},getAsync:function(b,c,d,e){if(e=a({},{progress:null},e),b===c)return d(null,0);if(0===b.length)return d(null,c.length);if(0===c.length)return d(null,b.length);var f,g,h,i,j,k,l,m=new Array(c.length+1);for(h=0;h<m.length;++h)m[h]=h;g=1,h=0,i=-1;var n=function(){for(k=(new Date).valueOf(),l=k;1e3>l-k;){if(c.length<=++i){if(m[i]=g,b.length<=++h)return d(null,g);g=h+1,i=0}f=g,g=m[i]+(b.charAt(h)===c.charAt(i)?0:1),j=f+1,g>j&&(g=j),j=m[i+1]+1,g>j&&(g=j),m[i]=f,l=(new Date).valueOf()}if(null!==e.progress)try{e.progress.call(null,100*h/b.length)}catch(a){return d("Progress callback: "+a.toString())}setTimeout(n(),0)};n()}};"undefined"!=typeof self?self.Levenshtein=b:"undefined"!=typeof define&&null!==define&&define.amd?define(function(){return b}):"undefined"!=typeof module&&null!==module?module.exports=b:"undefined"!=typeof window&&null!==window&&(window.Levenshtein=b)}();
{
"name": "fast-levenshtein",
"version": "1.0.4",
"version": "1.0.5",
"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