UNPKG

ngp-sort-pipe

Version:

Angular sort/orderby pipe, order one dimensional array or an array of objects

16 lines (14 loc) 1.97 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("lodash")):"function"==typeof define&&define.amd?define("ngp-sort-pipe",["exports","@angular/core","lodash"],t):t((e=e||self)["ngp-sort-pipe"]={},e.ng.core,e.lodash)}(this,(function(e,t,o){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */function r(e,t,o,r){var n,i=arguments.length,f=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(e,t,o,r);else for(var c=e.length-1;c>=0;c--)(n=e[c])&&(f=(i<3?n(f):i>3?n(t,o,f):n(t,o))||f);return i>3&&f&&Object.defineProperty(t,o,f),f}var n=function(){function e(){}return e.prototype.transform=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=""),e&&""!==t&&t?r&&""!==r?e.length<=1?e:o.orderBy(e,[r],[t]):"asc"===t?e.sort():e.sort().reverse():e},e=r([t.Pipe({name:"sortBy"})],e)}(),i=function(){function e(){}return e=r([t.NgModule({declarations:[n],exports:[n]})],e)}();e.NgpSortModule=i,e.SortByPipe=n,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=ngp-sort-pipe.umd.min.js.map