From 270500070cbacc0f1ffd490a188225595ced9b60 Mon Sep 17 00:00:00 2001 From: bubkoo Date: Tue, 26 Apr 2016 18:16:54 +0800 Subject: [PATCH] v1.0.5 --- dist/natsort.min.js | 55 +---------------------------------------- dist/natsort.min.js.map | 1 - package.json | 4 +-- 3 files changed, 3 insertions(+), 57 deletions(-) delete mode 100644 dist/natsort.min.js.map diff --git a/dist/natsort.min.js b/dist/natsort.min.js index b0c5570..2c6881c 100644 --- a/dist/natsort.min.js +++ b/dist/natsort.min.js @@ -1,54 +1 @@ -!function () { - "use strict"; - function e(e) { - function t(e) {return e.toLocaleLowerCase ? e.toLocaleLowerCase() : e.toLowerCase()} - - function r(e) {return e.replace(d, "\x00$1\x00").replace(/\0$/, "").replace(/^\0/, "").split("\x00")} - - function n(e, t) {return (!e.match(i) || 1 === t) && parseFloat(e) || e.replace(f, " ").replace(u, "") || 0} - - e = e || {}; - var a = e.desc ? -1 : 1, o = -a, i = /^0/, f = /\s+/g, u = /^\s+|\s+$/g, c = /[^\x00-\x80]/, s = /^0x[0-9a-f]+$/i, d = /(0x[\da-fA-F]+|(^[\+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|\d+)/g, p = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/, l = e.insensitive ? function (e) {return t("" + e).replace(u, "")} : function (e) {return ("" + e).replace(u, "")}; - return function (e, t) { - var i = l(e), f = l(t); - if (!i && !f) { - return 0; - } - if (!i && f) { - return o; - } - if (i && !f) { - return a; - } - var u = r(i), d = r(f), w = parseInt(i.match(s), 16) || 1 !== u.length && Date.parse(i), x = parseInt(f.match(s), 16) || w && f.match(p) && Date.parse(f) || null; - if (x) { - if (x > w) { - return o; - } - if (w > x) { - return a - } - } - for (var m = u.length, h = d.length, v = 0, g = Math.max(m, h); g > v; v++) { - var N = n(u[v] || "", m), y = n(d[v] || "", h); - if (isNaN(N) !== isNaN(y)) { - return isNaN(N) ? a : o; - } - if (c.test(N + y) && N.localeCompare) { - var C = N.localeCompare(y); - return C > 0 ? a : 0 > C ? o : 0 - } - if (y > N) { - return o; - } - if (N > y) { - return a - } - } - return 0 - } - } - - "object" == typeof exports && "object" == typeof module ? module.exports = e : "function" == typeof define && define.amd ? define([], function () {return e}) : "object" == typeof exports ? exports.natsort = e : ("undefined" != typeof window ? window : this).natsort = e -}(); -//# sourceMappingURL=./dist/natsort.min.js.map +!function(){"use strict";function e(e){function t(e){return e.toLocaleLowerCase?e.toLocaleLowerCase():e.toLowerCase()}function r(e){return e.replace(d,"\x00$1\x00").replace(/\0$/,"").replace(/^\0/,"").split("\x00")}function n(e,t){return(!e.match(i)||1===t)&&parseFloat(e)||e.replace(f," ").replace(u,"")||0}e=e||{};var a=e.desc?-1:1,o=-a,i=/^0/,f=/\s+/g,u=/^\s+|\s+$/g,c=/[^\x00-\x80]/,s=/^0x[0-9a-f]+$/i,d=/(0x[\da-fA-F]+|(^[\+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|\d+)/g,p=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=e.insensitive?function(e){return t(""+e).replace(u,"")}:function(e){return(""+e).replace(u,"")};return function(e,t){var i=l(e),f=l(t);if(!i&&!f)return 0;if(!i&&f)return o;if(i&&!f)return a;var u=r(i),d=r(f),w=parseInt(i.match(s),16)||1!==u.length&&Date.parse(i),x=parseInt(f.match(s),16)||w&&f.match(p)&&Date.parse(f)||null;if(x){if(x>w)return o;if(w>x)return a}for(var m=u.length,h=d.length,v=0,g=Math.max(m,h);g>v;v++){var N=n(u[v]||"",m),y=n(d[v]||"",h);if(isNaN(N)!==isNaN(y))return isNaN(N)?a:o;if(c.test(N+y)&&N.localeCompare){var C=N.localeCompare(y);return C>0?a:0>C?o:0}if(y>N)return o;if(N>y)return a}return 0}}"object"==typeof exports&&"object"==typeof module?module.exports=e:"function"==typeof define&&define.amd?define([],function(){return e}):"object"==typeof exports?exports.natsort=e:("undefined"!=typeof window?window:this).natsort=e}(); \ No newline at end of file diff --git a/dist/natsort.min.js.map b/dist/natsort.min.js.map deleted file mode 100644 index 0296a9b..0000000 --- a/dist/natsort.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["index.js"],"names":["natsort","options","lowerCase","s","toLocaleLowerCase","toLowerCase","tokenize","replace","nre","split","parse","l","match","ore","parseFloat","sre","tre","GREATER","desc","SMALLER","ure","hre","dre","normalize","insensitive","a","b","x","y","xArr","yArr","xD","parseInt","length","Date","yD","xL","yL","i","Math","max","xF","yF","isNaN","test","localeCompare","comp","exports","module","define","amd","window","this"],"mappings":"CAQA,WAEE,YAEA,SAASA,GAAQC,GA6Bf,QAASC,GAAUC,GACjB,MAAIA,GAAEC,kBACGD,EAAEC,oBAEJD,EAAEE,cAGX,QAASC,GAASH,GAChB,MAAOA,GAAEI,QAAQC,EAAK,cACnBD,QAAQ,MAAO,IACfA,QAAQ,MAAO,IACfE,MAAM,QAGX,QAASC,GAAMP,EAAGQ,GAGhB,QAASR,EAAES,MAAMC,IAAc,IAANF,IACpBG,WAAWX,IACXA,EAAEI,QAAQQ,EAAK,KAAKR,QAAQS,EAAK,KACjC,EA/CPf,EAAUA,KAEV,IAAIgB,GAAUhB,EAAQiB,KAAO,GAAK,EAC9BC,GAAWF,EAEXJ,EAAM,KACNE,EAAM,OACNC,EAAM,aAENI,EAAM,eAENC,EAAM,iBAGNb,EAAM,4EAENc,EAAM,iHAGNC,EAAYtB,EAAQuB,YACtB,SAAUrB,GACR,MAAOD,GAAU,GAAKC,GAAGI,QAAQS,EAAK,KAExC,SAAUb,GACR,OAAQ,GAAKA,GAAGI,QAAQS,EAAK,IA0BjC,OAAO,UA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ort.min.js"} \ No newline at end of file diff --git a/package.json b/package.json index 162ba57..b65d486 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "natsort", - "version": "1.0.4", + "version": "1.0.5", "description": "Javascript natural sort algorithm with unicode support.", "main": "index.js", "scripts": { @@ -11,7 +11,7 @@ "coveralls": "npm run coverage && coveralls < ./test/coverage/lcov.info", "prepublish": "npm test", "watch": "onchange 'index.js' 'test/**/*.js' -e 'test/coverage/**/*.js' -- npm test", - "build": "uglifyjs index.js -o ./dist/natsort.min.js --source-map ./dist/natsort.min.js.map -m -c" + "build": "uglifyjs index.js -o ./dist/natsort.min.js -m -c" }, "keywords": [ "natural",