You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
3.0 KiB
JavaScript

(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";window.sortPaths=require("./sort-paths.js");
},{"./sort-paths.js":3}],2:[function(require,module,exports){
"use strict";function splitRetain(e,t,r){if(r=defaults(r,{}),r.leadingSeparator=defaults(r.leadingSeparator,!1),assert.type(e,"string","`string` is not a string"),assert("string"==typeof t||t instanceof RegExp,"invalid `separator` type"),assert.type(r,"object","invalid `options` type"),assert.type(r.leadingSeparator,"boolean","invalid `options.leadingSeparator` type"),0===e.length)return[""];t=separatorToRegex(t);var n=e.split(t);if(1===n.length)return n;var s=[];for(r.leadingSeparator&&s.push(n.shift());n.length>0;)1===n.length?s.push(n.shift()):s.push(n.shift()+n.shift());return""===s[0]&&s.shift(),""===s[s.length-1]&&s.pop(),s}function separatorToRegex(e){return e instanceof RegExp?e:new RegExp("("+escapeRegex(e)+")","g")}function escapeRegex(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function assert(e,t){if(!e)throw new Error(t)}function defaults(e,t){return void 0===e?t:e}exports=module.exports=splitRetain,splitRetain.VERSION="1.0.1",assert.type=function(e,t,r){if(typeof e!==t)throw new Error(r)};
},{}],3:[function(require,module,exports){
"use strict";function sortPaths(t){assert(arguments.length>=2,"too few arguments"),assert(arguments.length<=3,"too many arguments");var r,e;2===arguments.length?(r=identity,e=arguments[1]):(r=arguments[1],e=arguments[2]),assert(isArray(t),"items is not an list"),assert(isFunction(r),"iteratee is not a function"),assert("string"==typeof e,"dirSeparator is not a String"),assert(1===e.length,"dirSeparator must be a single character");var n=t.map(function(t){var n=r(t);return assert("string"==typeof n,"item or iteratee(item) must be a String"),{item:t,pathTokens:splitRetain(n,e)}});return n.sort(createItemDTOComparator(e)),n.map(function(t){return t.item})}function createItemDTOComparator(t){return function(r,e){for(var n=r.pathTokens,a=e.pathTokens,o=0,i=Math.max(n.length,a.length);o<i;o++){if(!(o in n))return-1;if(!(o in a))return 1;var s=n[o].toLowerCase(),u=a[o].toLowerCase();if(s!==u){var c=s[s.length-1]===t;return c===(u[u.length-1]===t)?s<u?-1:1:c?1:-1}}return 0}}function assert(t,r){if(!t)throw new Error(r)}function identity(t){return t}function isFunction(t){return Boolean(t)&&"[object Function]"===Object.prototype.toString.call(t)}function isArray(t){return Boolean(t)&&"[object Array]"===Object.prototype.toString.call(t)}var splitRetain=require("split-retain");module.exports=sortPaths,sortPaths.VERSION="1.1.1";
},{"split-retain":2}]},{},[1]);