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.
17 lines
12 KiB
JavaScript
17 lines
12 KiB
JavaScript
11 months ago
|
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).sift={})}(this,(function(n){"use strict";
|
||
|
/*! *****************************************************************************
|
||
|
Copyright (c) Microsoft Corporation.
|
||
|
|
||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||
|
purpose with or without fee is hereby granted.
|
||
|
|
||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||
|
PERFORMANCE OF THIS SOFTWARE.
|
||
|
***************************************************************************** */var t=function(n,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,r)};function r(n,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=n}t(n,r),n.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}var i=function(n){var t="[object "+n+"]";return function(n){return u(n)===t}},u=function(n){return Object.prototype.toString.call(n)},e=function(n){return n instanceof Date?n.getTime():o(n)?n.map(e):n&&"function"==typeof n.toJSON?n.toJSON():n},o=i("Array"),f=i("Object"),s=i("Function"),c=function(n,t){if(null==n&&n==t)return!0;if(n===t)return!0;if(Object.prototype.toString.call(n)!==Object.prototype.toString.call(t))return!1;if(o(n)){if(n.length!==t.length)return!1;for(var r=0,i=n.length;r<i;r++)if(!c(n[r],t[r]))return!1;return!0}if(f(n)){if(Object.keys(n).length!==Object.keys(t).length)return!1;for(var u in n)if(!c(n[u],t[u]))return!1;return!0}return!1},h=function(n,t,r,i,u,e){var f=t[i];if(o(n)&&isNaN(Number(f)))for(var s=0,c=n.length;s<c;s++)if(!h(n[s],t,r,i,s,n))return!1;return i===t.length||null==n?r(n,u,e,0===i):h(n[f],t,r,i+1,f,n)},a=function(){function n(n,t,r,i){this.params=n,this.owneryQuery=t,this.options=r,this.name=i,this.init()}return n.prototype.init=function(){},n.prototype.reset=function(){this.done=!1,this.keep=!1},n}(),l=function(n){function t(t,r,i,u){var e=n.call(this,t,r,i)||this;return e.children=u,e}return r(t,n),t.prototype.reset=function(){this.keep=!1,this.done=!1;for(var n=0,t=this.children.length;n<t;n++)this.children[n].reset()},t.prototype.childrenNext=function(n,t,r,i){for(var u=!0,e=!0,o=0,f=this.children.length;o<f;o++){var s=this.children[o];if(s.done||s.next(n,t,r,i),s.keep||(e=!1),s.done){if(!s.keep)break}else u=!1}this.done=u,this.keep=e},t}(a),v=function(n){function t(t,r,i,u,e){var o=n.call(this,t,r,i,u)||this;return o.name=e,o}return r(t,n),t}(l),w=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.propop=!0,t}return r(t,n),t.prototype.next=function(n,t,r,i){this.childrenNext(n,t,r,i)},t}(l),p=function(n){function t(t,r,i,u,e){var o=n.call(this,r,i,u,e)||this;return o.keyPath=t,o.propop=!0,o.t=function(n,t,r,i){return o.childrenNext(n,t,r,i),!o.done},o}return r(t,n),t.prototype.next=function(n,t,r){h(n,this.keyPath,this.t,0,t,r)},t}(l),b=function(n,t){if(n instanceof Function)return n;if(n instanceof RegExp)return function(t){var r="string"==typeof t&&n.test(t);return n.lastIndex=0,r};var r=e(n);return function(n){return t(r,e(n))}},y=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.propop=!0,t}return r(t,n),t.prototype.init=function(){this.i=b(this.params,this.options.compare)},t.prototype.next=function(n,t,r){Array.isArray(r)&&!r.hasOwnProperty(t)||this.i(n,t,r)&&(this.done=!0,this.keep=!0)},t}(a),$=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.propop=!0,t}return r(t,n),t.prototype.next=function(){this.done=!0,this.keep=!1},t}(a),d=function(n){return t=function(t,r,i,u){var o=typeof e(t),f=n(t);return new y((function(n){return typeof e(n)===o&&f(n)}),r,i,u)},function(n,r,i,u){return null==n?new $(n,r,i,u):t(n,r,i,u)};var t},j=function(n,t,r,i){var u=i.operations[n];return u||m(n),u(t,r,i,n)},m=function(n){throw new Error("Unsupported operation: "+n)},O=function(n,t){for(var r in n)if(t.operations.hasOwnProperty(r)||"$"===r.charAt(0))return!0;return!1},g=function(n,t,r,i,u){if(O(t,u)){var e=x(t,r,u),o=e[0];if(e[1].length)throw new Error("Property queries must contain only operations, or exact objects.");return new p(n,t,i,u,o)}return new p(n,t,i,u,[new y(t,i,u)])},E=function(n,t,r){void 0===t&&(t=null);var i=void 0===r?{}:r,u=i.compare,e=i.operations,o={compare:u||c,operations:Object.assign({},e||{})},f=x(n,null,o),s=f[0],h=f[1],a=[];return s.length&&a.push(new
|
||
|
//# sourceMappingURL=sift.min.js.map
|