ngx-order-pipe.umd.min.js 2.4 KB

12
  1. !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("ngx-order-pipe",["exports","@angular/core"],r):r((e=e||self)["ngx-order-pipe"]={},e.ng.core)}(this,function(e,r){"use strict";function t(e,r,t,n){var o,i=arguments.length,u=i<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,r,t,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(u=(i<3?o(u):i>3?o(r,t,u):o(r,t))||u);return i>3&&u&&Object.defineProperty(r,t,u),u}var n=function(){function e(){}var n;return n=e,e.isString=function(e){return"string"==typeof e||e instanceof String},e.caseInsensitiveSort=function(e,r){return n.isString(e)&&n.isString(r)?e.localeCompare(r):n.defaultCompare(e,r)},e.defaultCompare=function(e,r){return e===r?0:null==e?1:null==r?-1:e>r?1:-1},e.parseExpression=function(e){return(e=(e=e.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split(".")},e.getValue=function(e,r){for(var t=0,n=r.length;t<n;++t){if(!e)return;var o=r[t];if(!(o in e))return;e="function"==typeof e[o]?e[o]():e[o]}return e},e.setValue=function(e,r,t){var n;for(n=0;n<t.length-1;n++)e=e[t[n]];e[t[n]]=r},e.prototype.transform=function(e,r,t,n,o){return void 0===n&&(n=!1),e?Array.isArray(r)?this.multiExpressionTransform(e,r,t,n,o):Array.isArray(e)?this.sortArray(e.slice(),r,t,n,o):"object"==typeof e?this.transformObject(Object.assign({},e),r,t,n,o):e:e},e.prototype.sortArray=function(e,r,t,o,i){var u,s=r&&-1!==r.indexOf(".");s&&(r=n.parseExpression(r)),u=i&&"function"==typeof i?i:o?n.caseInsensitiveSort:n.defaultCompare;var a=e.sort(function(e,t){return r?s?u(n.getValue(e,r),n.getValue(t,r)):e&&t?u(e[r],t[r]):u(e,t):u(e,t)});return t?a.reverse():a},e.prototype.transformObject=function(e,r,t,o,i){var u=n.parseExpression(r),s=u.pop(),a=n.getValue(e,u);return Array.isArray(a)||(u.push(s),s=null,a=n.getValue(e,u)),a?(n.setValue(e,this.transform(a,s,t,o),u),e):e},e.prototype.multiExpressionTransform=function(e,r,t,n,o){var i=this;return void 0===n&&(n=!1),r.reverse().reduce(function(e,r){return i.transform(e,r,t,n,o)},e)},e=n=t([r.Pipe({name:"orderBy",pure:!1})],e)}(),o=function(){function e(){}return e=t([r.NgModule({declarations:[n],exports:[n],providers:[n]})],e)}();e.OrderModule=o,e.OrderPipe=n,Object.defineProperty(e,"__esModule",{value:!0})});
  2. //# sourceMappingURL=ngx-order-pipe.umd.min.js.map