fast-levenshtein
Advanced tools
Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "fast-levenshtein", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"homepage": "https://github.com/hiddentao/fast-levenshtein", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -179,17 +179,21 @@ (function() { | ||
if(typeof self !== "undefined"){ | ||
self.Levenshtein = Levenshtein; | ||
} | ||
else if (typeof define !== "undefined" && define !== null && define.amd) { | ||
// amd | ||
if (typeof define !== "undefined" && define !== null && define.amd) { | ||
define(function() { | ||
return Levenshtein; | ||
}); | ||
} else if (typeof module !== "undefined" && module !== null) { | ||
} | ||
// commonjs | ||
else if (typeof module !== "undefined" && module !== null) { | ||
module.exports = Levenshtein; | ||
} else { | ||
if (typeof window !== "undefined" && window !== null) { | ||
window.Levenshtein = Levenshtein; | ||
} | ||
} | ||
// web worker | ||
else if (typeof self !== "undefined" && typeof self.postMessage === 'function' && typeof self.importScripts === 'function') { | ||
self.Levenshtein = Levenshtein; | ||
} | ||
// browser main thread | ||
else if (typeof window !== "undefined" && window !== null) { | ||
window.Levenshtein = Levenshtein; | ||
} | ||
}()); | ||
@@ -1,2 +0,2 @@ | ||
/*! 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)}(); | ||
/*! fast-levenshtein 2014-12-17. 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 define&&null!==define&&define.amd?define(function(){return b}):"undefined"!=typeof module&&null!==module?module.exports=b:"undefined"!=typeof self&&"function"==typeof self.postMessage&&"function"==typeof self.importScripts?self.Levenshtein=b:"undefined"!=typeof window&&null!==window&&(window.Levenshtein=b)}(); |
{ | ||
"name": "fast-levenshtein", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Efficient implementation of Levenshtein algorithm with asynchronous callback support", | ||
@@ -5,0 +5,0 @@ "main": "levenshtein.js", |
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
36467
569