From a7281c02d108710fe223ff611eb3cff8f0a749e9 Mon Sep 17 00:00:00 2001 From: David Rivera Date: Thu, 1 Mar 2018 16:47:11 -0600 Subject: [PATCH] Fixes #6. Wrong value for "main" field in package.json --- .babelrc | 14 +- README.md | 4 +- dist/sort-by-full.min.js | 4 +- dist/sort-by-full.min.map | 2 +- dist/sort-by.js | 451 ++++++++++++++++++++++++++++++++++++++ dist/sort-by.min.js | 4 +- dist/sort-by.min.map | 2 +- package-lock.json | 2 +- package.json | 4 +- webpack/build.js | 2 +- 10 files changed, 477 insertions(+), 12 deletions(-) create mode 100644 dist/sort-by.js diff --git a/.babelrc b/.babelrc index 4bc7dc2..b2b7b74 100644 --- a/.babelrc +++ b/.babelrc @@ -1,6 +1,18 @@ { "presets": [ - "env" + ["env", { + "targets": { + "browsers": [ + "last 3 Chrome versions", + "last 3 Firefox versions", + "last 3 Opera versions", + "Explorer >= 10", + "Safari >= 8", + "iOS >= 8", + "Android >= 4.4" + ] + } + }] ], "plugins": [ "babel-plugin-add-module-exports" diff --git a/README.md b/README.md index 08a6acb..7687504 100644 --- a/README.md +++ b/README.md @@ -127,9 +127,9 @@ the internal mapping, honoring the user mapping first: - + - + ``` In the above case, the function [`sortBy`](#examples) is included as diff --git a/dist/sort-by-full.min.js b/dist/sort-by-full.min.js index ce54799..cd31844 100644 --- a/dist/sort-by-full.min.js +++ b/dist/sort-by-full.min.js @@ -1,3 +1,3 @@ -/*! sortBy@v1.2.0. Jherax 2018. Visit https://github.com/jherax/array-sort-by */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.sortBy=e():t.sortBy=e()}("undefined"!=typeof self?self:this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=15)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return r.CHARS.accents.forEach(function(e,n){t=t.replace(i(e),r.CHARS.replacements[n])}),t.toUpperCase()};var r=n(1),o=u(n(5));function u(t){return t&&t.__esModule?t:{default:t}}var i=(0,u(n(6)).default)(function(t){var e=(0,o.default)(String.fromCharCode(t));return new RegExp(e,"g")});t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CHARS=void 0,e.default=function(t,e){i.apply(f.accents,(0,u.default)(t)),i.apply(f.replacements,e.split(""))};var r,o=n(4),u=(r=o)&&r.__esModule?r:{default:r};var i=Array.prototype.unshift,f=e.CHARS={accents:[194,226,192,224,193,225,196,228,195,227,197,229,202,234,200,232,201,233,203,235,206,238,204,236,205,237,207,239,212,244,210,242,211,243,214,246,213,245,219,251,217,249,218,250,220,252,209,241,221,253,255],replacements:"AaAaAaAaAaAaEeEeEeEeIiIiIiIiOoOoOoOoOoUuUuUuUuNnYyy".split("")}},function(t,e,n){t.exports=!n(14)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var r=f(n(0)),o=f(n(7)),u=f(n(8)),i=f(n(1));function f(t){return t&&t.__esModule?t:{default:t}}var c=function(t){for(var e=(t=[].concat(t)).length-1;e>=0;e-=1)"string"==typeof t[e]&&(t[e]=(0,r.default)(t[e]));return t};function a(t,e){var n=void 0,r=void 0,i=t.length;if("function"!=typeof e)return t.sort((0,o.default)());for(n=i;n;)r=t[n-=1],t[n]=[].concat(c(e.call(null,r,n)),r);for(t.sort(u.default),n=i;n;)r=t[n-=1],t[n]=r[r.length-1];return t}a.mapAccents=i.default,t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){for(var e=[],n=0;nn?1:-1}};var r,o=n(0),u=(r=o)&&r.__esModule?r:{default:r};t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var n=void 0,r=void 0;for(n in t)if(r=o(t[n],e[n]))return r;return 0};var r=/^desc:\s*/i;function o(t,e){var n=1;return"string"==typeof t&&r.test(t)&&(n=-1),t===e?0:(t>e?1:-1)*n}t.exports=e.default},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(13),o=n(24);t.exports=n(2)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(20),o=n(21),u=n(23),i=Object.defineProperty;e.f=n(2)?Object.defineProperty:function(t,e,n){if(r(t),e=u(e,!0),r(n),o)try{return i(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){n(16),t.exports=n(3)},function(t,e,n){"use strict";n(17)},function(t,e,n){n(18);var r=n(10).Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},function(t,e,n){var r=n(19);r(r.S+r.F*!n(2),"Object",{defineProperty:n(13).f})},function(t,e,n){var r=n(9),o=n(10),u=n(12),i=n(25),f=n(28),c=function(t,e,n){var a,l,s,p,d=t&c.F,v=t&c.G,y=t&c.S,x=t&c.P,_=t&c.B,b=v?r:y?r[e]||(r[e]={}):(r[e]||{}).prototype,h=v?o:o[e]||(o[e]={}),g=h.prototype||(h.prototype={});for(a in v&&(n=e),n)s=((l=!d&&b&&void 0!==b[a])?b:n)[a],p=_&&l?f(s,r):x&&"function"==typeof s?f(Function.call,s):s,b&&i(b,a,s,t&c.U),h[a]!=s&&u(h,a,p),x&&g[a]!=s&&(g[a]=s)};r.core=o,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e,n){var r=n(11);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){t.exports=!n(2)&&!n(14)(function(){return 7!=Object.defineProperty(n(22)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(11),o=n(9).document,u=r(o)&&r(o.createElement);t.exports=function(t){return u?o.createElement(t):{}}},function(t,e,n){var r=n(11);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(9),o=n(12),u=n(26),i=n(27)("src"),f=Function.toString,c=(""+f).split("toString");n(10).inspectSource=function(t){return f.call(t)},(t.exports=function(t,e,n,f){var a="function"==typeof n;a&&(u(n,"name")||o(n,"name",e)),t[e]!==n&&(a&&(u(n,i)||o(n,i,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:f?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[i]||f.call(this)})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(29);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}}])}); +/*! sortBy@v1.2.1. Jherax 2018. Visit https://github.com/jherax/array-sort-by */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.sortBy=e():t.sortBy=e()}("undefined"!=typeof self?self:this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=15)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return r.CHARS.accents.forEach(function(e,n){t=t.replace(i(e),r.CHARS.replacements[n])}),t.toUpperCase()};var r=n(1),o=u(n(4));function u(t){return t&&t.__esModule?t:{default:t}}var i=(0,u(n(5)).default)(function(t){var e=(0,o.default)(String.fromCharCode(t));return new RegExp(e,"g")});t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CHARS=void 0,e.default=function(t,e){i.apply(f.accents,(0,u.default)(t)),i.apply(f.replacements,e.split(""))};var r,o=n(3),u=(r=o)&&r.__esModule?r:{default:r};var i=Array.prototype.unshift,f=e.CHARS={accents:[194,226,192,224,193,225,196,228,195,227,197,229,202,234,200,232,201,233,203,235,206,238,204,236,205,237,207,239,212,244,210,242,211,243,214,246,213,245,219,251,217,249,218,250,220,252,209,241,221,253,255],replacements:"AaAaAaAaAaAaEeEeEeEeIiIiIiIiOoOoOoOoOoUuUuUuUuNnYyy".split("")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var r=f(n(0)),o=f(n(6)),u=f(n(7)),i=f(n(1));function f(t){return t&&t.__esModule?t:{default:t}}var c=function(t){for(var e=(t=[].concat(t)).length-1;e>=0;e-=1)"string"==typeof t[e]&&(t[e]=(0,r.default)(t[e]));return t};function a(t,e){var n=void 0,r=void 0,i=t.length;if("function"!=typeof e)return t.sort((0,o.default)());for(n=i;n;)r=t[n-=1],t[n]=[].concat(c(e.call(null,r,n)),r);for(t.sort(u.default),n=i;n;)r=t[n-=1],t[n]=r[r.length-1];return t}a.mapAccents=i.default,t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){for(var e=[],n=0;nn?1:-1}};var r,o=n(0),u=(r=o)&&r.__esModule?r:{default:r};t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var n=void 0,r=void 0;for(n in t)if(r=o(t[n],e[n]))return r;return 0};var r=/^desc:\s*/i;function o(t,e){var n=1;return"string"==typeof t&&r.test(t)&&(n=-1),t===e?0:(t>e?1:-1)*n}t.exports=e.default},function(t,e,n){t.exports=!n(14)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(13),o=n(24);t.exports=n(8)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(20),o=n(21),u=n(23),i=Object.defineProperty;e.f=n(8)?Object.defineProperty:function(t,e,n){if(r(t),e=u(e,!0),r(n),o)try{return i(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){n(16),t.exports=n(2)},function(t,e,n){"use strict";n(17)},function(t,e,n){n(18);var r=n(10).Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},function(t,e,n){var r=n(19);r(r.S+r.F*!n(8),"Object",{defineProperty:n(13).f})},function(t,e,n){var r=n(9),o=n(10),u=n(12),i=n(25),f=n(28),c=function(t,e,n){var a,l,s,p,d=t&c.F,v=t&c.G,y=t&c.S,x=t&c.P,_=t&c.B,b=v?r:y?r[e]||(r[e]={}):(r[e]||{}).prototype,h=v?o:o[e]||(o[e]={}),g=h.prototype||(h.prototype={});for(a in v&&(n=e),n)s=((l=!d&&b&&void 0!==b[a])?b:n)[a],p=_&&l?f(s,r):x&&"function"==typeof s?f(Function.call,s):s,b&&i(b,a,s,t&c.U),h[a]!=s&&u(h,a,p),x&&g[a]!=s&&(g[a]=s)};r.core=o,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e,n){var r=n(11);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){t.exports=!n(8)&&!n(14)(function(){return 7!=Object.defineProperty(n(22)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(11),o=n(9).document,u=r(o)&&r(o.createElement);t.exports=function(t){return u?o.createElement(t):{}}},function(t,e,n){var r=n(11);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(9),o=n(12),u=n(26),i=n(27)("src"),f=Function.toString,c=(""+f).split("toString");n(10).inspectSource=function(t){return f.call(t)},(t.exports=function(t,e,n,f){var a="function"==typeof n;a&&(u(n,"name")||o(n,"name",e)),t[e]!==n&&(a&&(u(n,i)||o(n,i,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:f?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[i]||f.call(this)})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(29);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}}])}); //# sourceMappingURL=sort-by-full.min.map \ No newline at end of file diff --git a/dist/sort-by-full.min.map b/dist/sort-by-full.min.map index a339f3b..5dc5ac5 100644 --- a/dist/sort-by-full.min.map +++ b/dist/sort-by-full.min.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 4a4e3a135866e3616de0","webpack:///./src/ignore-accent.js","webpack:///./src/map-accents.js","webpack:///./node_modules/core-js/modules/_descriptors.js","webpack:///./src/sort-by.js","webpack:///./src/generate-char-codes.js","webpack:///./src/escapeRegExp.js","webpack:///./src/memoize.js","webpack:///./src/default-sort.js","webpack:///./src/sort-items.js","webpack:///./node_modules/core-js/modules/_global.js","webpack:///./node_modules/core-js/modules/_core.js","webpack:///./node_modules/core-js/modules/_is-object.js","webpack:///./node_modules/core-js/modules/_hide.js","webpack:///./node_modules/core-js/modules/_object-dp.js","webpack:///./node_modules/core-js/modules/_fails.js","webpack:///./src/polyfills.js","webpack:///./node_modules/core-js/fn/object/define-property.js","webpack:///./node_modules/core-js/modules/es6.object.define-property.js","webpack:///./node_modules/core-js/modules/_export.js","webpack:///./node_modules/core-js/modules/_an-object.js","webpack:///./node_modules/core-js/modules/_ie8-dom-define.js","webpack:///./node_modules/core-js/modules/_dom-create.js","webpack:///./node_modules/core-js/modules/_to-primitive.js","webpack:///./node_modules/core-js/modules/_property-desc.js","webpack:///./node_modules/core-js/modules/_redefine.js","webpack:///./node_modules/core-js/modules/_has.js","webpack:///./node_modules/core-js/modules/_uid.js","webpack:///./node_modules/core-js/modules/_ctx.js","webpack:///./node_modules/core-js/modules/_a-function.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","text","_mapAccents","CHARS","accents","forEach","charCode","replace","getPattern","replacements","toUpperCase","default","accent","_escapeRegExp2","String","fromCharCode","RegExp","unshift","apply","_generateCharCodes2","split","_generateCharCodes","Array","a","sortBy","normalizeString","items","concat","length","_ignoreAccent2","array","parser","item","arrLength","sort","_defaultSort2","_sortItems2","mapAccents","_mapAccents2","charcodes","push","charCodeAt","ESCAPE_CHARS","func","cache","_len","arguments","args","_key","key","JSON","stringify","prev","next","_ignoreAccent","prevItems","nextItems","ordered","comparer","DESC","asc","test","global","window","Math","Function","__g","core","version","__e","it","dP","createDesc","value","f","anObject","IE8_DOM_DEFINE","toPrimitive","O","P","Attributes","e","TypeError","exec","$Object","desc","$export","S","F","hide","redefine","ctx","type","source","own","out","exp","IS_FORCED","IS_GLOBAL","G","IS_STATIC","IS_PROTO","IS_BIND","B","target","expProto","undefined","U","W","R","isObject","document","is","createElement","fn","val","toString","valueOf","bitmap","writable","has","SRC","$toString","TPL","inspectSource","safe","isFunction","join","id","px","random","aFunction","that","b"],"mappings":";CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iB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AAAlE,IACA6B,EAAA7B,KAAAkE,IACAW,IAAAN,EAAAL,EAAAM,IAAAhC,EAAA0B,EAAAM,EAAA3C,EAAA7B,GAAA,GAAA6B,EAAA7B,GAAA0E,EAAAI,KAAAjH,OAAAmC,MACA6B,IAAAhB,EACAgB,EAAA7B,GAAAkE,EACGU,EAGA/C,EAAA7B,GACH6B,EAAA7B,GAAAkE,EAEA1B,EAAAX,EAAA7B,EAAAkE,WALArC,EAAA7B,GACAwC,EAAAX,EAAA7B,EAAAkE,OAOClD,SAAApE,UAxBD,WAwBC,WACD,yBAAAvB,WAAAmJ,IAAAC,EAAA7I,KAAAP,uBC7BA,IAAAwB,KAAuBA,eACvB5B,EAAAD,QAAA,SAAAqG,EAAArB,GACA,OAAAnD,EAAAjB,KAAAyF,EAAArB,mBCFA,IAAA+E,EAAA,EACAC,EAAAjE,KAAAkE,SACAhK,EAAAD,QAAA,SAAAgF,GACA,gBAAAtB,YAAA+E,IAAAzD,EAAA,GAAAA,EAAA,QAAA+E,EAAAC,GAAAb,SAAA,uBCFA,IAAAe,EAAA3J,EAAA,IACAN,EAAAD,QAAA,SAAAiJ,EAAAkB,EAAAxG,GAEA,GADAuG,EAAAjB,QACAR,IAAA0B,EAAA,OAAAlB,EACA,OAAAtF,GACA,uBAAAL,GACA,OAAA2F,EAAArI,KAAAuJ,EAAA7G,IAEA,uBAAAA,EAAA8G,GACA,OAAAnB,EAAArI,KAAAuJ,EAAA7G,EAAA8G,IAEA,uBAAA9G,EAAA8G,EAAAtJ,GACA,OAAAmI,EAAArI,KAAAuJ,EAAA7G,EAAA8G,EAAAtJ,IAGA,kBACA,OAAAmI,EAAAhG,MAAAkH,EAAAtF,4BCjBA5E,EAAAD,QAAA,SAAAqG,GACA,sBAAAA,EAAA,MAAAY,UAAAZ,EAAA,uBACA,OAAAA","file":"sort-by-full.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"sortBy\"] = factory();\n\telse\n\t\troot[\"sortBy\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 15);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 4a4e3a135866e3616de0","import {CHARS} from './map-accents';\nimport escapeRegExp from './escapeRegExp';\nimport memoize from './memoize';\n\nconst getPattern = memoize((charCode) => {\n const accent = escapeRegExp(String.fromCharCode(charCode));\n return new RegExp(accent, 'g');\n});\n\n/**\n * Replaces accented characters to its equivalent with no accent.\n *\n * @param {String} text: the text to transform\n * @return {String}\n */\nexport default function ignoreAccent(text) {\n CHARS.accents.forEach((charCode, i) => {\n text = text.replace(getPattern(charCode), CHARS.replacements[i]);\n });\n // ignores case sensitive\n return text.toUpperCase();\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/ignore-accent.js","import generateCharCodes from './generate-char-codes';\n\nconst unshift = Array.prototype.unshift;\n\nexport const CHARS = {\n accents: [\n 194, 226, 192, 224, 193, 225, 196, 228, 195, 227, 197, 229, // ÂâÀàÁáÄäÃãÅå\n 202, 234, 200, 232, 201, 233, 203, 235, // ÊêÈèÉéËë\n 206, 238, 204, 236, 205, 237, 207, 239, // ÎîÌìÍíÏï\n 212, 244, 210, 242, 211, 243, 214, 246, 213, 245, // ÔôÒòÓóÖöÕõ\n 219, 251, 217, 249, 218, 250, 220, 252, // ÛûÙùÚúÜü\n 209, 241, 221, 253, 255, // ÑñÝýÿ\n ],\n replacements: 'AaAaAaAaAaAaEeEeEeEeIiIiIiIiOoOoOoOoOoUuUuUuUuNnYyy'.split(''),\n};\n\n/**\n * Registers a map of accents in order to sort strings correctly.\n *\n * @param {String} accents: the string with the accents\n * @param {String} replacements: the replacement for each accent\n */\nexport default function mapAccents(accents, replacements) {\n unshift.apply(CHARS.accents, generateCharCodes(accents));\n unshift.apply(CHARS.replacements, replacements.split(''));\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/map-accents.js","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_descriptors.js\n// module id = 2\n// module chunks = 0","/**\n * Sorts an array by allowing multiple sorting criteria.\n *\n * It applies the Schwartzian transform:\n * https://en.wikipedia.org/wiki/Schwartzian_transform\n *\n * Author: David Rivera\n * Github: https://github.com/jherax\n * License: \"MIT\"\n *\n * You can fork this project on github:\n * https://github.com/jherax/array-sort-by.git\n */\nimport ignoreAccent from './ignore-accent';\nimport defaultSort from './default-sort';\nimport sortItems from './sort-items';\nimport mapAccents from './map-accents';\n\nconst normalizeString = (items) => {\n items = [].concat(items);\n for (let i = items.length - 1; i >= 0; i -= 1) {\n if (typeof items[i] === 'string') {\n items[i] = ignoreAccent(items[i]);\n }\n }\n return items;\n};\n\n/**\n * @public\n *\n * Sorts an array by allowing multiple sorting criteria.\n *\n * @param {Array} array: the list of elements to sort\n * @param {Function} parser: transforms each item and specifies the sorting mode\n * @return {Array}\n */\nexport default function sortBy(array, parser) {\n let i, item;\n const arrLength = array.length;\n if (typeof parser !== 'function') {\n return array.sort(defaultSort());\n }\n // Schwartzian transform (decorate-sort-undecorate)\n for (i = arrLength; i;) {\n item = array[i -= 1];\n // decorate the array\n array[i] = [].concat(\n normalizeString(parser.call(null, item, i)),\n item,\n );\n }\n // console.log('decorated:', JSON.stringify(array));\n array.sort(sortItems);\n // undecorate the array\n for (i = arrLength; i;) {\n item = array[i -= 1];\n array[i] = item[item.length - 1];\n }\n return array;\n}\n\nsortBy.mapAccents = mapAccents;\n\n\n\n// WEBPACK FOOTER //\n// ./src/sort-by.js","/**\n * Gets the char-code value for every character in a text.\n *\n * @param {String} text: the values to be translated to the unicode char-code\n * @return {Array}\n */\nexport default function generateCharCodes(text) {\n const charcodes = [];\n for (let i = 0; i < text.length; i += 1) {\n charcodes.push(text.charCodeAt(i));\n }\n return charcodes;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/generate-char-codes.js","/**\n * @private\n */\nconst ESCAPE_CHARS = /[.*+?^=!:${}()|\\-[\\]/\\\\]/g;\n\n/**\n * Escapes the special characters in the entry parameter, so that\n * it can be used as a pattern in a regular expression constructor.\n *\n * @param {String} text: special characters to escape\n * @return {String}\n */\nexport default function escapeRegExp(text) {\n return text.replace(ESCAPE_CHARS, '\\\\$&');\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/escapeRegExp.js","/**\n * High-order function that memoizes a function, by creating a scope\n * to store the result of each function call, returning the cached\n * result when the same inputs is given.\n *\n * @description\n * Memoization is an optimization technique used primarily to speed up\n * functions by storing the results of expensive function calls, and returning\n * the cached result when the same inputs occur again.\n *\n * Each time a memoized function is called, its parameters are used as keys to index the cache.\n * If the index (key) is present, then it can be returned, without executing the entire function.\n * If the index is not cached, then all the body of the function is executed, and the result is\n * added to the cache.\n *\n * @see https://www.sitepoint.com/implementing-memoization-in-javascript/\n * @see https://gist.github.com/jherax/a3208b5c3d342a756008444ad81d8045\n *\n * @param {Function} func: function to memoize\n * @return {Function}\n */\nexport default function memoize(func) {\n const cache = {};\n return function memoized(...args) {\n const key = JSON.stringify(args);\n if (key in cache) return cache[key];\n cache[key] = func(...args);\n return cache[key];\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/memoize.js","import ignoreAccent from './ignore-accent';\n\n/**\n * Creates a closure that encapsulates the default sorting function.\n *\n * @return {Function}\n */\nexport default function defaultSort() {\n const cache = {};\n\n /**\n * Defines the default sorting mode (ASC)\n *\n * @param {Any} prev: element at n index to compare\n * @param {Any} next: element at n+1 index to compare\n * @return {Number}\n */\n return function sort(prev, next) {\n if (typeof prev === 'string') {\n if (!(prev in cache)) cache[prev] = ignoreAccent(prev);\n if (!(next in cache)) cache[next] = ignoreAccent(next);\n prev = cache[prev];\n next = cache[next];\n }\n if (prev === next) return 0;\n return (prev > next ? 1 : -1);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/default-sort.js","const DESC = /^desc:\\s*/i;\n\n/**\n * @private\n *\n * Compares each element and defines the sorting mode.\n * @see http://ow.ly/UvDD309zozK\n *\n * @param {Any} prev: n element to compare\n * @param {Any} next: n+1 element to compare\n * @return {Number}\n */\nfunction comparer(prev, next) {\n let asc = 1;\n if (typeof prev === 'string') {\n if (DESC.test(prev)) asc = -1;\n }\n if (prev === next) return 0;\n return (prev > next ? 1 : -1) * asc;\n}\n\n/**\n * Compares each decorated element.\n *\n * @param {Array} prevItems: decorated element at n index to compare\n * @param {Array} nextItems: decorated element at n+1 index to compare\n * @return {Number}\n */\nexport default function sortItems(prevItems, nextItems) {\n let i, ordered;\n for (i in prevItems) { // eslint-disable-line\n ordered = comparer(prevItems[i], nextItems[i]);\n if (ordered) return ordered;\n }\n return 0;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/sort-items.js","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_global.js\n// module id = 9\n// module chunks = 0","var core = module.exports = { version: '2.5.3' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_core.js\n// module id = 10\n// module chunks = 0","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_is-object.js\n// module id = 11\n// module chunks = 0","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_hide.js\n// module id = 12\n// module chunks = 0","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_object-dp.js\n// module id = 13\n// module chunks = 0","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_fails.js\n// module id = 14\n// module chunks = 0","import 'core-js/fn/object/define-property';\n\n\n\n// WEBPACK FOOTER //\n// ./src/polyfills.js","require('../../modules/es6.object.define-property');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function defineProperty(it, key, desc) {\n return $Object.defineProperty(it, key, desc);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/fn/object/define-property.js\n// module id = 17\n// module chunks = 0","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f });\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.object.define-property.js\n// module id = 18\n// module chunks = 0","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_export.js\n// module id = 19\n// module chunks = 0","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_an-object.js\n// module id = 20\n// module chunks = 0","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_ie8-dom-define.js\n// module id = 21\n// module chunks = 0","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_dom-create.js\n// module id = 22\n// module chunks = 0","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_to-primitive.js\n// module id = 23\n// module chunks = 0","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_property-desc.js\n// module id = 24\n// module chunks = 0","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_redefine.js\n// module id = 25\n// module chunks = 0","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_has.js\n// module id = 26\n// module chunks = 0","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_uid.js\n// module id = 27\n// module chunks = 0","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_ctx.js\n// module id = 28\n// module chunks = 0","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_a-function.js\n// module id = 29\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap e36f63b6785e7c05fec9","webpack:///./src/ignore-accent.js","webpack:///./src/map-accents.js","webpack:///./src/sort-by.js","webpack:///./src/generate-char-codes.js","webpack:///./src/escapeRegExp.js","webpack:///./src/memoize.js","webpack:///./src/default-sort.js","webpack:///./src/sort-items.js","webpack:///./node_modules/core-js/modules/_descriptors.js","webpack:///./node_modules/core-js/modules/_global.js","webpack:///./node_modules/core-js/modules/_core.js","webpack:///./node_modules/core-js/modules/_is-object.js","webpack:///./node_modules/core-js/modules/_hide.js","webpack:///./node_modules/core-js/modules/_object-dp.js","webpack:///./node_modules/core-js/modules/_fails.js","webpack:///./src/polyfills.js","webpack:///./node_modules/core-js/fn/object/define-property.js","webpack:///./node_modules/core-js/modules/es6.object.define-property.js","webpack:///./node_modules/core-js/modules/_export.js","webpack:///./node_modules/core-js/modules/_an-object.js","webpack:///./node_modules/core-js/modules/_ie8-dom-define.js","webpack:///./node_modules/core-js/modules/_dom-create.js","webpack:///./node_modules/core-js/modules/_to-primitive.js","webpack:///./node_modules/core-js/modules/_property-desc.js","webpack:///./node_modules/core-js/modules/_redefine.js","webpack:///./node_modules/core-js/modules/_has.js","webpack:///./node_modules/core-js/modules/_uid.js","webpack:///./node_modules/core-js/modules/_ctx.js","webpack:///./node_modules/core-js/modules/_a-function.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","text","_mapAccents","CHARS","accents","forEach","charCode","replace","getPattern","replacements","toUpperCase","default","accent","_escapeRegExp2","String","fromCharCode","RegExp","unshift","apply","_generateCharCodes2","split","_generateCharCodes","Array","sortBy","normalizeString","items","concat","length","_ignoreAccent2","array","parser","item","arrLength","sort","_defaultSort2","_sortItems2","mapAccents","_mapAccents2","charcodes","push","charCodeAt","ESCAPE_CHARS","func","cache","_len","arguments","args","_key","key","JSON","stringify","prev","next","_ignoreAccent","prevItems","nextItems","ordered","comparer","DESC","asc","test","a","global","window","Math","Function","__g","core","version","__e","it","dP","createDesc","value","f","anObject","IE8_DOM_DEFINE","toPrimitive","O","P","Attributes","e","TypeError","exec","$Object","desc","$export","S","F","hide","redefine","ctx","type","source","own","out","exp","IS_FORCED","IS_GLOBAL","G","IS_STATIC","IS_PROTO","IS_BIND","B","target","expProto","undefined","U","W","R","isObject","document","is","createElement","fn","val","toString","valueOf","bitmap","writable","has","SRC","$toString","TPL","inspectSource","safe","isFunction","join","id","px","random","aFunction","that","b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ition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"sortBy\"] = factory();\n\telse\n\t\troot[\"sortBy\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 15);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap e36f63b6785e7c05fec9","import {CHARS} from './map-accents';\nimport escapeRegExp from './escapeRegExp';\nimport memoize from './memoize';\n\nconst getPattern = memoize((charCode) => {\n const accent = escapeRegExp(String.fromCharCode(charCode));\n return new RegExp(accent, 'g');\n});\n\n/**\n * Replaces accented characters to its equivalent with no accent.\n *\n * @param {String} text: the text to transform\n * @return {String}\n */\nexport default function ignoreAccent(text) {\n CHARS.accents.forEach((charCode, i) => {\n text = text.replace(getPattern(charCode), CHARS.replacements[i]);\n });\n // ignores case sensitive\n return text.toUpperCase();\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/ignore-accent.js","import generateCharCodes from './generate-char-codes';\n\nconst unshift = Array.prototype.unshift;\n\nexport const CHARS = {\n accents: [\n 194, 226, 192, 224, 193, 225, 196, 228, 195, 227, 197, 229, // ÂâÀàÁáÄäÃãÅå\n 202, 234, 200, 232, 201, 233, 203, 235, // ÊêÈèÉéËë\n 206, 238, 204, 236, 205, 237, 207, 239, // ÎîÌìÍíÏï\n 212, 244, 210, 242, 211, 243, 214, 246, 213, 245, // ÔôÒòÓóÖöÕõ\n 219, 251, 217, 249, 218, 250, 220, 252, // ÛûÙùÚúÜü\n 209, 241, 221, 253, 255, // ÑñÝýÿ\n ],\n replacements: 'AaAaAaAaAaAaEeEeEeEeIiIiIiIiOoOoOoOoOoUuUuUuUuNnYyy'.split(''),\n};\n\n/**\n * Registers a map of accents in order to sort strings correctly.\n *\n * @param {String} accents: the string with the accents\n * @param {String} replacements: the replacement for each accent\n */\nexport default function mapAccents(accents, replacements) {\n unshift.apply(CHARS.accents, generateCharCodes(accents));\n unshift.apply(CHARS.replacements, replacements.split(''));\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/map-accents.js","/**\n * Sorts an array by allowing multiple sorting criteria.\n *\n * It applies the Schwartzian transform:\n * https://en.wikipedia.org/wiki/Schwartzian_transform\n *\n * Author: David Rivera\n * Github: https://github.com/jherax\n * License: \"MIT\"\n *\n * You can fork this project on github:\n * https://github.com/jherax/array-sort-by.git\n */\nimport ignoreAccent from './ignore-accent';\nimport defaultSort from './default-sort';\nimport sortItems from './sort-items';\nimport mapAccents from './map-accents';\n\nconst normalizeString = (items) => {\n items = [].concat(items);\n for (let i = items.length - 1; i >= 0; i -= 1) {\n if (typeof items[i] === 'string') {\n items[i] = ignoreAccent(items[i]);\n }\n }\n return items;\n};\n\n/**\n * @public\n *\n * Sorts an array by allowing multiple sorting criteria.\n *\n * @param {Array} array: the list of elements to sort\n * @param {Function} parser: transforms each item and specifies the sorting mode\n * @return {Array}\n */\nexport default function sortBy(array, parser) {\n let i, item;\n const arrLength = array.length;\n if (typeof parser !== 'function') {\n return array.sort(defaultSort());\n }\n // Schwartzian transform (decorate-sort-undecorate)\n for (i = arrLength; i;) {\n item = array[i -= 1];\n // decorate the array\n array[i] = [].concat(\n normalizeString(parser.call(null, item, i)),\n item,\n );\n }\n // console.log('decorated:', JSON.stringify(array));\n array.sort(sortItems);\n // undecorate the array\n for (i = arrLength; i;) {\n item = array[i -= 1];\n array[i] = item[item.length - 1];\n }\n return array;\n}\n\nsortBy.mapAccents = mapAccents;\n\n\n\n// WEBPACK FOOTER //\n// ./src/sort-by.js","/**\n * Gets the char-code value for every character in a text.\n *\n * @param {String} text: the values to be translated to the unicode char-code\n * @return {Array}\n */\nexport default function generateCharCodes(text) {\n const charcodes = [];\n for (let i = 0; i < text.length; i += 1) {\n charcodes.push(text.charCodeAt(i));\n }\n return charcodes;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/generate-char-codes.js","/**\n * @private\n */\nconst ESCAPE_CHARS = /[.*+?^=!:${}()|\\-[\\]/\\\\]/g;\n\n/**\n * Escapes the special characters in the entry parameter, so that\n * it can be used as a pattern in a regular expression constructor.\n *\n * @param {String} text: special characters to escape\n * @return {String}\n */\nexport default function escapeRegExp(text) {\n return text.replace(ESCAPE_CHARS, '\\\\$&');\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/escapeRegExp.js","/**\n * High-order function that memoizes a function, by creating a scope\n * to store the result of each function call, returning the cached\n * result when the same inputs is given.\n *\n * @description\n * Memoization is an optimization technique used primarily to speed up\n * functions by storing the results of expensive function calls, and returning\n * the cached result when the same inputs occur again.\n *\n * Each time a memoized function is called, its parameters are used as keys to index the cache.\n * If the index (key) is present, then it can be returned, without executing the entire function.\n * If the index is not cached, then all the body of the function is executed, and the result is\n * added to the cache.\n *\n * @see https://www.sitepoint.com/implementing-memoization-in-javascript/\n * @see https://gist.github.com/jherax/a3208b5c3d342a756008444ad81d8045\n *\n * @param {Function} func: function to memoize\n * @return {Function}\n */\nexport default function memoize(func) {\n const cache = {};\n return function memoized(...args) {\n const key = JSON.stringify(args);\n if (key in cache) return cache[key];\n cache[key] = func(...args);\n return cache[key];\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/memoize.js","import ignoreAccent from './ignore-accent';\n\n/**\n * Creates a closure that encapsulates the default sorting function.\n *\n * @return {Function}\n */\nexport default function defaultSort() {\n const cache = {};\n\n /**\n * Defines the default sorting mode (ASC)\n *\n * @param {Any} prev: element at n index to compare\n * @param {Any} next: element at n+1 index to compare\n * @return {Number}\n */\n return function sort(prev, next) {\n if (typeof prev === 'string') {\n if (!(prev in cache)) cache[prev] = ignoreAccent(prev);\n if (!(next in cache)) cache[next] = ignoreAccent(next);\n prev = cache[prev];\n next = cache[next];\n }\n if (prev === next) return 0;\n return (prev > next ? 1 : -1);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/default-sort.js","const DESC = /^desc:\\s*/i;\n\n/**\n * @private\n *\n * Compares each element and defines the sorting mode.\n * @see http://ow.ly/UvDD309zozK\n *\n * @param {Any} prev: n element to compare\n * @param {Any} next: n+1 element to compare\n * @return {Number}\n */\nfunction comparer(prev, next) {\n let asc = 1;\n if (typeof prev === 'string') {\n if (DESC.test(prev)) asc = -1;\n }\n if (prev === next) return 0;\n return (prev > next ? 1 : -1) * asc;\n}\n\n/**\n * Compares each decorated element.\n *\n * @param {Array} prevItems: decorated element at n index to compare\n * @param {Array} nextItems: decorated element at n+1 index to compare\n * @return {Number}\n */\nexport default function sortItems(prevItems, nextItems) {\n let i, ordered;\n for (i in prevItems) { // eslint-disable-line\n ordered = comparer(prevItems[i], nextItems[i]);\n if (ordered) return ordered;\n }\n return 0;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/sort-items.js","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_descriptors.js\n// module id = 8\n// module chunks = 0","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_global.js\n// module id = 9\n// module chunks = 0","var core = module.exports = { version: '2.5.3' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_core.js\n// module id = 10\n// module chunks = 0","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_is-object.js\n// module id = 11\n// module chunks = 0","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_hide.js\n// module id = 12\n// module chunks = 0","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_object-dp.js\n// module id = 13\n// module chunks = 0","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_fails.js\n// module id = 14\n// module chunks = 0","import 'core-js/fn/object/define-property';\n\n\n\n// WEBPACK FOOTER //\n// ./src/polyfills.js","require('../../modules/es6.object.define-property');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function defineProperty(it, key, desc) {\n return $Object.defineProperty(it, key, desc);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/fn/object/define-property.js\n// module id = 17\n// module chunks = 0","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f });\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.object.define-property.js\n// module id = 18\n// module chunks = 0","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_export.js\n// module id = 19\n// module chunks = 0","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_an-object.js\n// module id = 20\n// module chunks = 0","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_ie8-dom-define.js\n// module id = 21\n// module chunks = 0","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_dom-create.js\n// module id = 22\n// module chunks = 0","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_to-primitive.js\n// module id = 23\n// module chunks = 0","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_property-desc.js\n// module id = 24\n// module chunks = 0","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_redefine.js\n// module id = 25\n// module chunks = 0","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_has.js\n// module id = 26\n// module chunks = 0","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_uid.js\n// module id = 27\n// module chunks = 0","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_ctx.js\n// module id = 28\n// module chunks = 0","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_a-function.js\n// module id = 29\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/sort-by.js b/dist/sort-by.js new file mode 100644 index 0000000..8657dd3 --- /dev/null +++ b/dist/sort-by.js @@ -0,0 +1,451 @@ +/*! sortBy@v1.2.1. Jherax 2018. Visit https://github.com/jherax/array-sort-by */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["sortBy"] = factory(); + else + root["sortBy"] = factory(); +})(typeof self !== 'undefined' ? self : this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 2); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = ignoreAccent; + +var _mapAccents = __webpack_require__(1); + +var _escapeRegExp = __webpack_require__(4); + +var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp); + +var _memoize = __webpack_require__(5); + +var _memoize2 = _interopRequireDefault(_memoize); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var getPattern = (0, _memoize2.default)(function (charCode) { + var accent = (0, _escapeRegExp2.default)(String.fromCharCode(charCode)); + return new RegExp(accent, 'g'); +}); + +/** + * Replaces accented characters to its equivalent with no accent. + * + * @param {String} text: the text to transform + * @return {String} + */ +function ignoreAccent(text) { + _mapAccents.CHARS.accents.forEach(function (charCode, i) { + text = text.replace(getPattern(charCode), _mapAccents.CHARS.replacements[i]); + }); + // ignores case sensitive + return text.toUpperCase(); +} +module.exports = exports['default']; + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.CHARS = undefined; +exports.default = mapAccents; + +var _generateCharCodes = __webpack_require__(3); + +var _generateCharCodes2 = _interopRequireDefault(_generateCharCodes); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var unshift = Array.prototype.unshift; + +var CHARS = exports.CHARS = { + accents: [194, 226, 192, 224, 193, 225, 196, 228, 195, 227, 197, 229, // ÂâÀàÁáÄäÃãÅå + 202, 234, 200, 232, 201, 233, 203, 235, // ÊêÈèÉéËë + 206, 238, 204, 236, 205, 237, 207, 239, // ÎîÌìÍíÏï + 212, 244, 210, 242, 211, 243, 214, 246, 213, 245, // ÔôÒòÓóÖöÕõ + 219, 251, 217, 249, 218, 250, 220, 252, // ÛûÙùÚúÜü + 209, 241, 221, 253, 255], + replacements: 'AaAaAaAaAaAaEeEeEeEeIiIiIiIiOoOoOoOoOoUuUuUuUuNnYyy'.split('') +}; + +/** + * Registers a map of accents in order to sort strings correctly. + * + * @param {String} accents: the string with the accents + * @param {String} replacements: the replacement for each accent + */ +function mapAccents(accents, replacements) { + unshift.apply(CHARS.accents, (0, _generateCharCodes2.default)(accents)); + unshift.apply(CHARS.replacements, replacements.split('')); +} + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = sortBy; + +var _ignoreAccent = __webpack_require__(0); + +var _ignoreAccent2 = _interopRequireDefault(_ignoreAccent); + +var _defaultSort = __webpack_require__(6); + +var _defaultSort2 = _interopRequireDefault(_defaultSort); + +var _sortItems = __webpack_require__(7); + +var _sortItems2 = _interopRequireDefault(_sortItems); + +var _mapAccents = __webpack_require__(1); + +var _mapAccents2 = _interopRequireDefault(_mapAccents); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Sorts an array by allowing multiple sorting criteria. + * + * It applies the Schwartzian transform: + * https://en.wikipedia.org/wiki/Schwartzian_transform + * + * Author: David Rivera + * Github: https://github.com/jherax + * License: "MIT" + * + * You can fork this project on github: + * https://github.com/jherax/array-sort-by.git + */ +var normalizeString = function normalizeString(items) { + items = [].concat(items); + for (var i = items.length - 1; i >= 0; i -= 1) { + if (typeof items[i] === 'string') { + items[i] = (0, _ignoreAccent2.default)(items[i]); + } + } + return items; +}; + +/** + * @public + * + * Sorts an array by allowing multiple sorting criteria. + * + * @param {Array} array: the list of elements to sort + * @param {Function} parser: transforms each item and specifies the sorting mode + * @return {Array} + */ +function sortBy(array, parser) { + var i = void 0, + item = void 0; + var arrLength = array.length; + if (typeof parser !== 'function') { + return array.sort((0, _defaultSort2.default)()); + } + // Schwartzian transform (decorate-sort-undecorate) + for (i = arrLength; i;) { + item = array[i -= 1]; + // decorate the array + array[i] = [].concat(normalizeString(parser.call(null, item, i)), item); + } + // console.log('decorated:', JSON.stringify(array)); + array.sort(_sortItems2.default); + // undecorate the array + for (i = arrLength; i;) { + item = array[i -= 1]; + array[i] = item[item.length - 1]; + } + return array; +} + +sortBy.mapAccents = _mapAccents2.default; +module.exports = exports['default']; + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = generateCharCodes; +/** + * Gets the char-code value for every character in a text. + * + * @param {String} text: the values to be translated to the unicode char-code + * @return {Array} + */ +function generateCharCodes(text) { + var charcodes = []; + for (var i = 0; i < text.length; i += 1) { + charcodes.push(text.charCodeAt(i)); + } + return charcodes; +} +module.exports = exports["default"]; + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = escapeRegExp; +/** + * @private + */ +var ESCAPE_CHARS = /[.*+?^=!:${}()|\-[\]/\\]/g; + +/** + * Escapes the special characters in the entry parameter, so that + * it can be used as a pattern in a regular expression constructor. + * + * @param {String} text: special characters to escape + * @return {String} + */ +function escapeRegExp(text) { + return text.replace(ESCAPE_CHARS, '\\$&'); +} +module.exports = exports['default']; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = memoize; +/** + * High-order function that memoizes a function, by creating a scope + * to store the result of each function call, returning the cached + * result when the same inputs is given. + * + * @description + * Memoization is an optimization technique used primarily to speed up + * functions by storing the results of expensive function calls, and returning + * the cached result when the same inputs occur again. + * + * Each time a memoized function is called, its parameters are used as keys to index the cache. + * If the index (key) is present, then it can be returned, without executing the entire function. + * If the index is not cached, then all the body of the function is executed, and the result is + * added to the cache. + * + * @see https://www.sitepoint.com/implementing-memoization-in-javascript/ + * @see https://gist.github.com/jherax/a3208b5c3d342a756008444ad81d8045 + * + * @param {Function} func: function to memoize + * @return {Function} + */ +function memoize(func) { + var cache = {}; + return function memoized() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var key = JSON.stringify(args); + if (key in cache) return cache[key]; + cache[key] = func.apply(undefined, args); + return cache[key]; + }; +} +module.exports = exports["default"]; + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = defaultSort; + +var _ignoreAccent = __webpack_require__(0); + +var _ignoreAccent2 = _interopRequireDefault(_ignoreAccent); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Creates a closure that encapsulates the default sorting function. + * + * @return {Function} + */ +function defaultSort() { + var cache = {}; + + /** + * Defines the default sorting mode (ASC) + * + * @param {Any} prev: element at n index to compare + * @param {Any} next: element at n+1 index to compare + * @return {Number} + */ + return function sort(prev, next) { + if (typeof prev === 'string') { + if (!(prev in cache)) cache[prev] = (0, _ignoreAccent2.default)(prev); + if (!(next in cache)) cache[next] = (0, _ignoreAccent2.default)(next); + prev = cache[prev]; + next = cache[next]; + } + if (prev === next) return 0; + return prev > next ? 1 : -1; + }; +} +module.exports = exports['default']; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = sortItems; +var DESC = /^desc:\s*/i; + +/** + * @private + * + * Compares each element and defines the sorting mode. + * @see http://ow.ly/UvDD309zozK + * + * @param {Any} prev: n element to compare + * @param {Any} next: n+1 element to compare + * @return {Number} + */ +function comparer(prev, next) { + var asc = 1; + if (typeof prev === 'string') { + if (DESC.test(prev)) asc = -1; + } + if (prev === next) return 0; + return (prev > next ? 1 : -1) * asc; +} + +/** + * Compares each decorated element. + * + * @param {Array} prevItems: decorated element at n index to compare + * @param {Array} nextItems: decorated element at n+1 index to compare + * @return {Number} + */ +function sortItems(prevItems, nextItems) { + var i = void 0, + ordered = void 0; + for (i in prevItems) { + // eslint-disable-line + ordered = comparer(prevItems[i], nextItems[i]); + if (ordered) return ordered; + } + return 0; +} +module.exports = exports['default']; + +/***/ }) +/******/ ]); +}); \ No newline at end of file diff --git a/dist/sort-by.min.js b/dist/sort-by.min.js index 0435168..5fc2b13 100644 --- a/dist/sort-by.min.js +++ b/dist/sort-by.min.js @@ -1,3 +1,3 @@ -/*! sortBy@v1.2.0. Jherax 2018. Visit https://github.com/jherax/array-sort-by */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.sortBy=t():e.sortBy=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var u=t[n]={i:n,l:!1,exports:{}};return e[n].call(u.exports,u,u.exports,r),u.l=!0,u.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return n.CHARS.accents.forEach(function(t,r){e=e.replace(f(t),n.CHARS.replacements[r])}),e.toUpperCase()};var n=r(1),u=o(r(5));function o(e){return e&&e.__esModule?e:{default:e}}var f=(0,o(r(6)).default)(function(e){var t=(0,u.default)(String.fromCharCode(e));return new RegExp(t,"g")});e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CHARS=void 0,t.default=function(e,t){f.apply(a.accents,(0,o.default)(e)),f.apply(a.replacements,t.split(""))};var n,u=r(4),o=(n=u)&&n.__esModule?n:{default:n};var f=Array.prototype.unshift,a=t.CHARS={accents:[194,226,192,224,193,225,196,228,195,227,197,229,202,234,200,232,201,233,203,235,206,238,204,236,205,237,207,239,212,244,210,242,211,243,214,246,213,245,219,251,217,249,218,250,220,252,209,241,221,253,255],replacements:"AaAaAaAaAaAaEeEeEeEeIiIiIiIiOoOoOoOoOoUuUuUuUuNnYyy".split("")}},,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var n=a(r(0)),u=a(r(7)),o=a(r(8)),f=a(r(1));function a(e){return e&&e.__esModule?e:{default:e}}var i=function(e){for(var t=(e=[].concat(e)).length-1;t>=0;t-=1)"string"==typeof e[t]&&(e[t]=(0,n.default)(e[t]));return e};function c(e,t){var r=void 0,n=void 0,f=e.length;if("function"!=typeof t)return e.sort((0,u.default)());for(r=f;r;)n=e[r-=1],e[r]=[].concat(i(t.call(null,n,r)),n);for(e.sort(o.default),r=f;r;)n=e[r-=1],e[r]=n[n.length-1];return e}c.mapAccents=f.default,e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){for(var t=[],r=0;rr?1:-1}};var n,u=r(0),o=(n=u)&&n.__esModule?n:{default:n};e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=void 0,n=void 0;for(r in e)if(n=u(e[r],t[r]))return n;return 0};var n=/^desc:\s*/i;function u(e,t){var r=1;return"string"==typeof e&&n.test(e)&&(r=-1),e===t?0:(e>t?1:-1)*r}e.exports=t.default}])}); +/*! sortBy@v1.2.1. Jherax 2018. Visit https://github.com/jherax/array-sort-by */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.sortBy=t():e.sortBy=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var u=t[n]={i:n,l:!1,exports:{}};return e[n].call(u.exports,u,u.exports,r),u.l=!0,u.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return n.CHARS.accents.forEach(function(t,r){e=e.replace(f(t),n.CHARS.replacements[r])}),e.toUpperCase()};var n=r(1),u=o(r(4));function o(e){return e&&e.__esModule?e:{default:e}}var f=(0,o(r(5)).default)(function(e){var t=(0,u.default)(String.fromCharCode(e));return new RegExp(t,"g")});e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CHARS=void 0,t.default=function(e,t){f.apply(a.accents,(0,o.default)(e)),f.apply(a.replacements,t.split(""))};var n,u=r(3),o=(n=u)&&n.__esModule?n:{default:n};var f=Array.prototype.unshift,a=t.CHARS={accents:[194,226,192,224,193,225,196,228,195,227,197,229,202,234,200,232,201,233,203,235,206,238,204,236,205,237,207,239,212,244,210,242,211,243,214,246,213,245,219,251,217,249,218,250,220,252,209,241,221,253,255],replacements:"AaAaAaAaAaAaEeEeEeEeIiIiIiIiOoOoOoOoOoUuUuUuUuNnYyy".split("")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var n=a(r(0)),u=a(r(6)),o=a(r(7)),f=a(r(1));function a(e){return e&&e.__esModule?e:{default:e}}var i=function(e){for(var t=(e=[].concat(e)).length-1;t>=0;t-=1)"string"==typeof e[t]&&(e[t]=(0,n.default)(e[t]));return e};function c(e,t){var r=void 0,n=void 0,f=e.length;if("function"!=typeof t)return e.sort((0,u.default)());for(r=f;r;)n=e[r-=1],e[r]=[].concat(i(t.call(null,n,r)),n);for(e.sort(o.default),r=f;r;)n=e[r-=1],e[r]=n[n.length-1];return e}c.mapAccents=f.default,e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){for(var t=[],r=0;rr?1:-1}};var n,u=r(0),o=(n=u)&&n.__esModule?n:{default:n};e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=void 0,n=void 0;for(r in e)if(n=u(e[r],t[r]))return n;return 0};var n=/^desc:\s*/i;function u(e,t){var r=1;return"string"==typeof e&&n.test(e)&&(r=-1),e===t?0:(e>t?1:-1)*r}e.exports=t.default}])}); //# sourceMappingURL=sort-by.min.map \ No newline at end of file diff --git a/dist/sort-by.min.map b/dist/sort-by.min.map index ef23446..b8e186a 100644 --- a/dist/sort-by.min.map +++ b/dist/sort-by.min.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 4a4e3a135866e3616de0","webpack:///./src/ignore-accent.js","webpack:///./src/map-accents.js","webpack:///./src/sort-by.js","webpack:///./src/generate-char-codes.js","webpack:///./src/escapeRegExp.js","webpack:///./src/memoize.js","webpack:///./src/default-sort.js","webpack:///./src/sort-items.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","text","_mapAccents","CHARS","accents","forEach","charCode","replace","getPattern","replacements","toUpperCase","default","accent","_escapeRegExp2","String","fromCharCode","RegExp","unshift","apply","_generateCharCodes2","split","_generateCharCodes","Array","sortBy","normalizeString","items","concat","length","_ignoreAccent2","array","parser","item","arrLength","sort","_defaultSort2","_sortItems2","mapAccents","_mapAccents2","charcodes","push","charCodeAt","ESCAPE_CHARS","func","cache","_len","arguments","args","_key","key","JSON","stringify","prev","next","_ignoreAccent","prevItems","nextItems","ordered","comparer","DESC","asc","test"],"mappings":";CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,UAAAH,GACA,iBAAAC,QACAA,QAAA,OAAAD,IAEAD,EAAA,OAAAC,IARA,CASC,oBAAAK,UAAAC,KAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAR,QAGA,IAAAC,EAAAK,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAV,YAUA,OANAW,EAAAH,GAAAI,KAAA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AAAC,UAAAlB,OAANmB,EAAMxB,MAAAsB,GAAAG,EAAA,EAAAA,EAAAH,EAAAG,IAAND,EAAMC,GAAAF,UAAAE,GAChC,IAAMC,EAAMC,KAAKC,UAAUJ,GAC3B,OAAIE,KAAOL,EAAcA,EAAMK,IAC/BL,EAAMK,GAAON,eAAQI,GACdH,EAAMK,mHCpBF,WACb,IAAML,KASN,OAAO,SAAcQ,EAAMC,GAOzB,MANoB,iBAATD,IACHA,KAAQR,IAAQA,EAAMQ,IAAQ,EAAAvB,EAAAjB,SAAawC,IAC3CC,KAAQT,IAAQA,EAAMS,IAAQ,EAAAxB,EAAAjB,SAAayC,IACjDD,EAAOR,EAAMQ,GACbC,EAAOT,EAAMS,IAEXD,IAASC,EAAa,EAClBD,EAAOC,EAAO,GAAK,IAzB/B,MAAAC,EAAA7E,EAAA,oJC4Be,SAAmB8E,EAAWC,GAC3C,IAAI7E,SAAG8E,SACP,IAAK9E,KAAK4E,EAER,GADAE,EAAUC,EAASH,EAAU5E,GAAI6E,EAAU7E,IAC9B,OAAO8E,EAEtB,OAAO,GAlCT,IAAME,EAAO,aAYb,SAASD,EAASN,EAAMC,GACtB,IAAIO,EAAM,EAIV,MAHoB,iBAATR,GACLO,EAAKE,KAAKT,KAAOQ,GAAO,GAE1BR,IAASC,EAAa,GAClBD,EAAOC,EAAO,GAAK,GAAKO","file":"sort-by.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"sortBy\"] = factory();\n\telse\n\t\troot[\"sortBy\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 4a4e3a135866e3616de0","import {CHARS} from './map-accents';\nimport escapeRegExp from './escapeRegExp';\nimport memoize from './memoize';\n\nconst getPattern = memoize((charCode) => {\n const accent = escapeRegExp(String.fromCharCode(charCode));\n return new RegExp(accent, 'g');\n});\n\n/**\n * Replaces accented characters to its equivalent with no accent.\n *\n * @param {String} text: the text to transform\n * @return {String}\n */\nexport default function ignoreAccent(text) {\n CHARS.accents.forEach((charCode, i) => {\n text = text.replace(getPattern(charCode), CHARS.replacements[i]);\n });\n // ignores case sensitive\n return text.toUpperCase();\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/ignore-accent.js","import generateCharCodes from './generate-char-codes';\n\nconst unshift = Array.prototype.unshift;\n\nexport const CHARS = {\n accents: [\n 194, 226, 192, 224, 193, 225, 196, 228, 195, 227, 197, 229, // ÂâÀàÁáÄäÃãÅå\n 202, 234, 200, 232, 201, 233, 203, 235, // ÊêÈèÉéËë\n 206, 238, 204, 236, 205, 237, 207, 239, // ÎîÌìÍíÏï\n 212, 244, 210, 242, 211, 243, 214, 246, 213, 245, // ÔôÒòÓóÖöÕõ\n 219, 251, 217, 249, 218, 250, 220, 252, // ÛûÙùÚúÜü\n 209, 241, 221, 253, 255, // ÑñÝýÿ\n ],\n replacements: 'AaAaAaAaAaAaEeEeEeEeIiIiIiIiOoOoOoOoOoUuUuUuUuNnYyy'.split(''),\n};\n\n/**\n * Registers a map of accents in order to sort strings correctly.\n *\n * @param {String} accents: the string with the accents\n * @param {String} replacements: the replacement for each accent\n */\nexport default function mapAccents(accents, replacements) {\n unshift.apply(CHARS.accents, generateCharCodes(accents));\n unshift.apply(CHARS.replacements, replacements.split(''));\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/map-accents.js","/**\n * Sorts an array by allowing multiple sorting criteria.\n *\n * It applies the Schwartzian transform:\n * https://en.wikipedia.org/wiki/Schwartzian_transform\n *\n * Author: David Rivera\n * Github: https://github.com/jherax\n * License: \"MIT\"\n *\n * You can fork this project on github:\n * https://github.com/jherax/array-sort-by.git\n */\nimport ignoreAccent from './ignore-accent';\nimport defaultSort from './default-sort';\nimport sortItems from './sort-items';\nimport mapAccents from './map-accents';\n\nconst normalizeString = (items) => {\n items = [].concat(items);\n for (let i = items.length - 1; i >= 0; i -= 1) {\n if (typeof items[i] === 'string') {\n items[i] = ignoreAccent(items[i]);\n }\n }\n return items;\n};\n\n/**\n * @public\n *\n * Sorts an array by allowing multiple sorting criteria.\n *\n * @param {Array} array: the list of elements to sort\n * @param {Function} parser: transforms each item and specifies the sorting mode\n * @return {Array}\n */\nexport default function sortBy(array, parser) {\n let i, item;\n const arrLength = array.length;\n if (typeof parser !== 'function') {\n return array.sort(defaultSort());\n }\n // Schwartzian transform (decorate-sort-undecorate)\n for (i = arrLength; i;) {\n item = array[i -= 1];\n // decorate the array\n array[i] = [].concat(\n normalizeString(parser.call(null, item, i)),\n item,\n );\n }\n // console.log('decorated:', JSON.stringify(array));\n array.sort(sortItems);\n // undecorate the array\n for (i = arrLength; i;) {\n item = array[i -= 1];\n array[i] = item[item.length - 1];\n }\n return array;\n}\n\nsortBy.mapAccents = mapAccents;\n\n\n\n// WEBPACK FOOTER //\n// ./src/sort-by.js","/**\n * Gets the char-code value for every character in a text.\n *\n * @param {String} text: the values to be translated to the unicode char-code\n * @return {Array}\n */\nexport default function generateCharCodes(text) {\n const charcodes = [];\n for (let i = 0; i < text.length; i += 1) {\n charcodes.push(text.charCodeAt(i));\n }\n return charcodes;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/generate-char-codes.js","/**\n * @private\n */\nconst ESCAPE_CHARS = /[.*+?^=!:${}()|\\-[\\]/\\\\]/g;\n\n/**\n * Escapes the special characters in the entry parameter, so that\n * it can be used as a pattern in a regular expression constructor.\n *\n * @param {String} text: special characters to escape\n * @return {String}\n */\nexport default function escapeRegExp(text) {\n return text.replace(ESCAPE_CHARS, '\\\\$&');\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/escapeRegExp.js","/**\n * High-order function that memoizes a function, by creating a scope\n * to store the result of each function call, returning the cached\n * result when the same inputs is given.\n *\n * @description\n * Memoization is an optimization technique used primarily to speed up\n * functions by storing the results of expensive function calls, and returning\n * the cached result when the same inputs occur again.\n *\n * Each time a memoized function is called, its parameters are used as keys to index the cache.\n * If the index (key) is present, then it can be returned, without executing the entire function.\n * If the index is not cached, then all the body of the function is executed, and the result is\n * added to the cache.\n *\n * @see https://www.sitepoint.com/implementing-memoization-in-javascript/\n * @see https://gist.github.com/jherax/a3208b5c3d342a756008444ad81d8045\n *\n * @param {Function} func: function to memoize\n * @return {Function}\n */\nexport default function memoize(func) {\n const cache = {};\n return function memoized(...args) {\n const key = JSON.stringify(args);\n if (key in cache) return cache[key];\n cache[key] = func(...args);\n return cache[key];\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/memoize.js","import ignoreAccent from './ignore-accent';\n\n/**\n * Creates a closure that encapsulates the default sorting function.\n *\n * @return {Function}\n */\nexport default function defaultSort() {\n const cache = {};\n\n /**\n * Defines the default sorting mode (ASC)\n *\n * @param {Any} prev: element at n index to compare\n * @param {Any} next: element at n+1 index to compare\n * @return {Number}\n */\n return function sort(prev, next) {\n if (typeof prev === 'string') {\n if (!(prev in cache)) cache[prev] = ignoreAccent(prev);\n if (!(next in cache)) cache[next] = ignoreAccent(next);\n prev = cache[prev];\n next = cache[next];\n }\n if (prev === next) return 0;\n return (prev > next ? 1 : -1);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/default-sort.js","const DESC = /^desc:\\s*/i;\n\n/**\n * @private\n *\n * Compares each element and defines the sorting mode.\n * @see http://ow.ly/UvDD309zozK\n *\n * @param {Any} prev: n element to compare\n * @param {Any} next: n+1 element to compare\n * @return {Number}\n */\nfunction comparer(prev, next) {\n let asc = 1;\n if (typeof prev === 'string') {\n if (DESC.test(prev)) asc = -1;\n }\n if (prev === next) return 0;\n return (prev > next ? 1 : -1) * asc;\n}\n\n/**\n * Compares each decorated element.\n *\n * @param {Array} prevItems: decorated element at n index to compare\n * @param {Array} nextItems: decorated element at n+1 index to compare\n * @return {Number}\n */\nexport default function sortItems(prevItems, nextItems) {\n let i, ordered;\n for (i in prevItems) { // eslint-disable-line\n ordered = comparer(prevItems[i], nextItems[i]);\n if (ordered) return ordered;\n }\n return 0;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/sort-items.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap e36f63b6785e7c05fec9","webpack:///./src/ignore-accent.js","webpack:///./src/map-accents.js","webpack:///./src/sort-by.js","webpack:///./src/generate-char-codes.js","webpack:///./src/escapeRegExp.js","webpack:///./src/memoize.js","webpack:///./src/default-sort.js","webpack:///./src/sort-items.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","text","_mapAccents","CHARS","accents","forEach","charCode","replace","getPattern","replacements","toUpperCase","default","accent","_escapeRegExp2","String","fromCharCode","RegExp","unshift","apply","_generateCharCodes2","split","_generateCharCodes","Array","sortBy","normalizeString","items","concat","length","_ignoreAccent2","array","parser","item","arrLength","sort","_defaultSort2","_sortItems2","mapAccents","_mapAccents2","charcodes","push","charCodeAt","ESCAPE_CHARS","func","cache","_len","arguments","args","_key","key","JSON","stringify","prev","next","_ignoreAccent","prevItems","nextItems","ordered","comparer","DESC","asc","test"],"mappings":";CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,UAAAH,GACA,iBAAAC,QACAA,QAAA,OAAAD,IAEAD,EAAA,OAAAC,IARA,CASC,oBAAAK,UAAAC,KAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAR,QAGA,IAAAC,EAAAK,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAV,YAUA,OANAW,EAAAH,GAAAI,KAAAX,EAAAD,QAAAC,IAAAD,QAAAO,GAGAN,EAAAS,GAAA,EAGAT,EAAAD,QAqCA,OAhCAO,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAf,EAAAgB,EAAA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AcA,EAAMK,IAC/BL,EAAMK,GAAON,eAAQI,GACdH,EAAMK,mHCpBF,WACb,IAAML,KASN,OAAO,SAAcQ,EAAMC,GAOzB,MANoB,iBAATD,IACHA,KAAQR,IAAQA,EAAMQ,IAAQ,EAAAvB,EAAAjB,SAAawC,IAC3CC,KAAQT,IAAQA,EAAMS,IAAQ,EAAAxB,EAAAjB,SAAayC,IACjDD,EAAOR,EAAMQ,GACbC,EAAOT,EAAMS,IAEXD,IAASC,EAAa,EAClBD,EAAOC,EAAO,GAAK,IAzB/B,MAAAC,EAAA7E,EAAA,oJC4Be,SAAmB8E,EAAWC,GAC3C,IAAI7E,SAAG8E,SACP,IAAK9E,KAAK4E,EAER,GADAE,EAAUC,EAASH,EAAU5E,GAAI6E,EAAU7E,IAC9B,OAAO8E,EAEtB,OAAO,GAlCT,IAAME,EAAO,aAYb,SAASD,EAASN,EAAMC,GACtB,IAAIO,EAAM,EAIV,MAHoB,iBAATR,GACLO,EAAKE,KAAKT,KAAOQ,GAAO,GAE1BR,IAASC,EAAa,GAClBD,EAAOC,EAAO,GAAK,GAAKO","file":"sort-by.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"sortBy\"] = factory();\n\telse\n\t\troot[\"sortBy\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap e36f63b6785e7c05fec9","import {CHARS} from './map-accents';\nimport escapeRegExp from './escapeRegExp';\nimport memoize from './memoize';\n\nconst getPattern = memoize((charCode) => {\n const accent = escapeRegExp(String.fromCharCode(charCode));\n return new RegExp(accent, 'g');\n});\n\n/**\n * Replaces accented characters to its equivalent with no accent.\n *\n * @param {String} text: the text to transform\n * @return {String}\n */\nexport default function ignoreAccent(text) {\n CHARS.accents.forEach((charCode, i) => {\n text = text.replace(getPattern(charCode), CHARS.replacements[i]);\n });\n // ignores case sensitive\n return text.toUpperCase();\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/ignore-accent.js","import generateCharCodes from './generate-char-codes';\n\nconst unshift = Array.prototype.unshift;\n\nexport const CHARS = {\n accents: [\n 194, 226, 192, 224, 193, 225, 196, 228, 195, 227, 197, 229, // ÂâÀàÁáÄäÃãÅå\n 202, 234, 200, 232, 201, 233, 203, 235, // ÊêÈèÉéËë\n 206, 238, 204, 236, 205, 237, 207, 239, // ÎîÌìÍíÏï\n 212, 244, 210, 242, 211, 243, 214, 246, 213, 245, // ÔôÒòÓóÖöÕõ\n 219, 251, 217, 249, 218, 250, 220, 252, // ÛûÙùÚúÜü\n 209, 241, 221, 253, 255, // ÑñÝýÿ\n ],\n replacements: 'AaAaAaAaAaAaEeEeEeEeIiIiIiIiOoOoOoOoOoUuUuUuUuNnYyy'.split(''),\n};\n\n/**\n * Registers a map of accents in order to sort strings correctly.\n *\n * @param {String} accents: the string with the accents\n * @param {String} replacements: the replacement for each accent\n */\nexport default function mapAccents(accents, replacements) {\n unshift.apply(CHARS.accents, generateCharCodes(accents));\n unshift.apply(CHARS.replacements, replacements.split(''));\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/map-accents.js","/**\n * Sorts an array by allowing multiple sorting criteria.\n *\n * It applies the Schwartzian transform:\n * https://en.wikipedia.org/wiki/Schwartzian_transform\n *\n * Author: David Rivera\n * Github: https://github.com/jherax\n * License: \"MIT\"\n *\n * You can fork this project on github:\n * https://github.com/jherax/array-sort-by.git\n */\nimport ignoreAccent from './ignore-accent';\nimport defaultSort from './default-sort';\nimport sortItems from './sort-items';\nimport mapAccents from './map-accents';\n\nconst normalizeString = (items) => {\n items = [].concat(items);\n for (let i = items.length - 1; i >= 0; i -= 1) {\n if (typeof items[i] === 'string') {\n items[i] = ignoreAccent(items[i]);\n }\n }\n return items;\n};\n\n/**\n * @public\n *\n * Sorts an array by allowing multiple sorting criteria.\n *\n * @param {Array} array: the list of elements to sort\n * @param {Function} parser: transforms each item and specifies the sorting mode\n * @return {Array}\n */\nexport default function sortBy(array, parser) {\n let i, item;\n const arrLength = array.length;\n if (typeof parser !== 'function') {\n return array.sort(defaultSort());\n }\n // Schwartzian transform (decorate-sort-undecorate)\n for (i = arrLength; i;) {\n item = array[i -= 1];\n // decorate the array\n array[i] = [].concat(\n normalizeString(parser.call(null, item, i)),\n item,\n );\n }\n // console.log('decorated:', JSON.stringify(array));\n array.sort(sortItems);\n // undecorate the array\n for (i = arrLength; i;) {\n item = array[i -= 1];\n array[i] = item[item.length - 1];\n }\n return array;\n}\n\nsortBy.mapAccents = mapAccents;\n\n\n\n// WEBPACK FOOTER //\n// ./src/sort-by.js","/**\n * Gets the char-code value for every character in a text.\n *\n * @param {String} text: the values to be translated to the unicode char-code\n * @return {Array}\n */\nexport default function generateCharCodes(text) {\n const charcodes = [];\n for (let i = 0; i < text.length; i += 1) {\n charcodes.push(text.charCodeAt(i));\n }\n return charcodes;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/generate-char-codes.js","/**\n * @private\n */\nconst ESCAPE_CHARS = /[.*+?^=!:${}()|\\-[\\]/\\\\]/g;\n\n/**\n * Escapes the special characters in the entry parameter, so that\n * it can be used as a pattern in a regular expression constructor.\n *\n * @param {String} text: special characters to escape\n * @return {String}\n */\nexport default function escapeRegExp(text) {\n return text.replace(ESCAPE_CHARS, '\\\\$&');\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/escapeRegExp.js","/**\n * High-order function that memoizes a function, by creating a scope\n * to store the result of each function call, returning the cached\n * result when the same inputs is given.\n *\n * @description\n * Memoization is an optimization technique used primarily to speed up\n * functions by storing the results of expensive function calls, and returning\n * the cached result when the same inputs occur again.\n *\n * Each time a memoized function is called, its parameters are used as keys to index the cache.\n * If the index (key) is present, then it can be returned, without executing the entire function.\n * If the index is not cached, then all the body of the function is executed, and the result is\n * added to the cache.\n *\n * @see https://www.sitepoint.com/implementing-memoization-in-javascript/\n * @see https://gist.github.com/jherax/a3208b5c3d342a756008444ad81d8045\n *\n * @param {Function} func: function to memoize\n * @return {Function}\n */\nexport default function memoize(func) {\n const cache = {};\n return function memoized(...args) {\n const key = JSON.stringify(args);\n if (key in cache) return cache[key];\n cache[key] = func(...args);\n return cache[key];\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/memoize.js","import ignoreAccent from './ignore-accent';\n\n/**\n * Creates a closure that encapsulates the default sorting function.\n *\n * @return {Function}\n */\nexport default function defaultSort() {\n const cache = {};\n\n /**\n * Defines the default sorting mode (ASC)\n *\n * @param {Any} prev: element at n index to compare\n * @param {Any} next: element at n+1 index to compare\n * @return {Number}\n */\n return function sort(prev, next) {\n if (typeof prev === 'string') {\n if (!(prev in cache)) cache[prev] = ignoreAccent(prev);\n if (!(next in cache)) cache[next] = ignoreAccent(next);\n prev = cache[prev];\n next = cache[next];\n }\n if (prev === next) return 0;\n return (prev > next ? 1 : -1);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/default-sort.js","const DESC = /^desc:\\s*/i;\n\n/**\n * @private\n *\n * Compares each element and defines the sorting mode.\n * @see http://ow.ly/UvDD309zozK\n *\n * @param {Any} prev: n element to compare\n * @param {Any} next: n+1 element to compare\n * @return {Number}\n */\nfunction comparer(prev, next) {\n let asc = 1;\n if (typeof prev === 'string') {\n if (DESC.test(prev)) asc = -1;\n }\n if (prev === next) return 0;\n return (prev > next ? 1 : -1) * asc;\n}\n\n/**\n * Compares each decorated element.\n *\n * @param {Array} prevItems: decorated element at n index to compare\n * @param {Array} nextItems: decorated element at n+1 index to compare\n * @return {Number}\n */\nexport default function sortItems(prevItems, nextItems) {\n let i, ordered;\n for (i in prevItems) { // eslint-disable-line\n ordered = comparer(prevItems[i], nextItems[i]);\n if (ordered) return ordered;\n }\n return 0;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/sort-items.js"],"sourceRoot":""} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 912006d..e202667 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "array-sort-by", - "version": "1.2.0", + "version": "1.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ceaa989..acb7e19 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,12 @@ { "name": "array-sort-by", - "version": "1.2.0", + "version": "1.2.1", "description": "Sorts an array and allows specify multiple sorting criteria", "author": "David Rivera ", "main": "dist/sort-by.js", "module": "src/sort-by.js", + "browser": "dist/sort-by.min.js", + "unpkg": "dist/sort-by.min.js", "keywords": [ "array", "sort", diff --git a/webpack/build.js b/webpack/build.js index d8aafb0..4d0e665 100644 --- a/webpack/build.js +++ b/webpack/build.js @@ -9,7 +9,7 @@ const jsFiles = /\.min\.js($|\?)/i; const config = { entry: { - // 'sort-by': PATHS.source.js, + 'sort-by': PATHS.source.js, 'sort-by.min': PATHS.source.js, 'sort-by-full.min': [PATHS.source.polyfills, PATHS.source.js], },