You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
5.3 KiB
1 line
5.3 KiB
5 years ago
|
!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.sift=t():n.sift=t()}(window,function(){return function(n){var t={};function r(e){if(t[e])return t[e].exports;var o=t[e]={i:e,l:!1,exports:{}};return n[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=n,r.c=t,r.d=function(n,t,e){r.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:e})},r.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.t=function(n,t){if(1&t&&(n=r(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var o in n)r.d(e,o,function(t){return n[t]}.bind(null,o));return e},r.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(t,"a",t),t},r.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},r.p="",r(r.s=0)}([function(n,t,r){n.exports=r(1)},function(n,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function o(n){return"function"==typeof n}function u(n){return"[object Array]"===Object.prototype.toString.call(n)}function i(n){return n instanceof Date?n.getTime():u(n)?n.map(i):n&&"function"==typeof n.toJSON?n.toJSON():n}function f(n,t){return o(n.get)?n.get(t):n[t]}function c(n){return function(t,r){if(!u(r)||!r.length)return n(t,r);for(var e=0,o=r.length;e<o;e++)if(n(t,f(r,e)))return!0;return!1}}function l(n,t,r,e){return n.v(n.a,t,r,e)}t.default=function(n,t,r){o(t)&&(r=t,t=void 0);var e=y(n,r);function u(n,t,r){return l(e,n,t,r)}if(t)return t.filter(u);return u},t.indexOf=function(n,t,r){return d(t,y(n,r))},t.compare=b;var a={$eq:c(function(n,t){return n(t)}),$ne:function(n){return function(t,r){if(!u(r)||!r.length)return n(t,r);for(var e=0,o=r.length;e<o;e++)if(!n(t,f(r,e)))return!1;return!0}}(function(n,t){return!n(t)}),$gt:c(function(n,t){return b(i(t),n)>0}),$gte:c(function(n,t){return b(i(t),n)>=0}),$lt:c(function(n,t){return b(i(t),n)<0}),$lte:c(function(n,t){return b(i(t),n)<=0}),$mod:c(function(n,t){return t%n[0]==n[1]}),$in:function(n,t){if(!(t instanceof Array)){var r=i(t);if(r===t&&"object"===(void 0===t?"undefined":e(t)))for(u=n.length;u--;)if(String(n[u])===String(t)&&"[object Object]"!==String(t))return!0;if(void 0===r)for(u=n.length;u--;)if(null==n[u])return!0;for(u=n.length;u--;){var o=l(y(f(n,u),void 0),t,u,n);if(o&&"[object Object]"!==String(o)&&"[object Object]"!==String(t))return!0}return!!~n.indexOf(r)}for(var u=t.length;u--;)if(~n.indexOf(i(f(t,u))))return!0;return!1},$nin:function(n,t,r,e){return!a.$in(n,t,r,e)},$not:function(n,t,r,e){return!l(n,t,r,e)},$type:function(n,t){return void 0!=t&&(t instanceof n||t.constructor==n)},$all:function(n,t,r,e){return a.$and(n,t,r,e)},$size:function(n,t){return!!t&&n===t.length},$or:function(n,t,r,e){for(var o=0,u=n.length;o<u;o++)if(l(f(n,o),t,r,e))return!0;return!1},$nor:function(n,t,r,e){return!a.$or(n,t,r,e)},$and:function(n,t,r,e){for(var o=0,u=n.length;o<u;o++)if(!l(f(n,o),t,r,e))return!1;return!0},$regex:c(function(n,t){return"string"==typeof t&&n.test(t)}),$where:function(n,t,r,e){return n.call(t,t,r,e)},$elemMatch:function(n,t,r,e){return u(t)?!!~d(t,n):l(n,t,r,e)},$exists:function(n,t,r,e){return e.hasOwnProperty(r)===n}},p={$eq:function(n){return n instanceof RegExp?function(t){return"string"==typeof t&&n.test(t)}:n instanceof Function?n:u(n)&&!n.length?function(n){return u(n)&&!n.length}:null===n?function(n){return null==n}:function(t){return 0===b(i(t),i(n))}},$ne:function(n){return p.$eq(n)},$and:function(n){return n.map($)},$all:function(n){return p.$and(n)},$or:function(n){return n.map($)},$nor:function(n){return n.m
|