MCPcopy
hub / github.com/leeoniya/uFuzzy / o

Function o

demos/lib/itemsjs.min.js:1–1  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

1(function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,t.itemsjs=e()}})(function(){var e=Math.floor,t=Math.max,n=Math.min,r;return function(){function d(s,e,n){function t(o,i){if(!e[o]){if(!s[o]){var l="function"==typeof require&&require;if(!i&&l)return l(o,!0);if(r)return r(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var a=e[o]={exports:{}};s[o][0].call(a.exports,function(e){var r=s[o][1][e];return t(r||e)},a,a.exports,d,s,e,n)}return e[o].exports}for(var r="function"==typeof require&&require,o=0;o<n.length;o++)t(n[o]);return t}return d}()({1:[function(e,t){'use strict';t.exports=e("./src/index")},{"./src/index":9}],2:[function(e,t){function n(e,t){if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("both parameters have to be an array");if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function r(e){e=p(e),e=o(e);var t=h("OR",e),n=t.map(function(e){for(var t=h("AND",e),n=[],o=[],d=0;d<t.length;d++)u(t[d])?n.push(r(t[d])):o.push(t[d]);return n.push([o]),s(n)});return l(n)}function o(e){return e.replace(/[\s]+/g," ")}function d(e,t){var n=[];return e.forEach(function(e){t.forEach(function(t){n.push(a(e,t))})}),n}function s(e){for(var t=[[]],n=0;n<e.length;n++)t=d(t,e[n]);return t}function a(e,t){return e.concat(t)}function l(e){for(var t=e[0],n=1;n<e.length;n++)t=t.concat(e[n]);return t}function p(e){if("("===e.charAt(0))for(var t=0,n=0;n<e.length;n++)if("("===e.charAt(n)?t++:")"===e.charAt(n)&&t--,0===t)return n===e.length-1?e.substring(1,e.length-1):e;return e}function u(e){return!!~e.search(/\(|\)/)}function h(e,t){for(var n=t.split(" "+e+" "),r=[],o=[],d=0;d<n.length;d++)if(u(n[d])||0<o.length){o.push(n[d]);var s=""+o,a=(s.match(/\(/g)||[]).length,l=(s.match(/\)/g)||[]).length;a===l&&(r.push(o.join(" "+e+" ")),o=[])}else r.push(n[d]);return r}t.exports={deduplicateOr:function(e,t){var r=t?e:e.map(function(e){return e.sort()});return r.reduce(function(e,t){for(var r=0;r<e.length;r++)if(n(e[r],t))return e;return e.push(t),e},[])},andAndMerge:a,orAndOrMerge:d,orsAndMerge:s,mergeOrs:l,splitRoot:h,removeDoubleWhiteSpace:o,removeOuterBrackets:p,parseBooleanQuery:r,containsBrackets:u}},{}],3:[function(e,r){"use strict";function o(e){if(this.words=[],e)if(Symbol&&Symbol.iterator&&void 0!==e[Symbol.iterator]){const t=e[Symbol.iterator]();for(let e=t.next();!e.done;)this.add(e.value),e=t.next()}else for(let t=0;t<e.length;t++)this.add(e[t])}o.prototype.fromWords=function(e){const t=Object.create(o.prototype);return t.words=e,t},o.prototype.add=function(e){this.resize(e),this.words[e>>>5]|=1<<e},o.prototype.flip=function(e){this.resize(e),this.words[e>>>5]^=1<<e},o.prototype.clear=function(){this.words.length=0},o.prototype.remove=function(e){this.resize(e),this.words[e>>>5]&=~(1<<e)},o.prototype.isEmpty=function(){const e=this.words.length;for(let t=0;t<e;t++)if(0!==this.words[t])return!1;return!0},o.prototype.has=function(e){return 0!=(this.words[e>>>5]&1<<e)},o.prototype.checkedAdd=function(e){this.resize(e);const t=this.words[e>>>5],n=t|1<<e;return this.words[e>>>5]=n,(n^t)>>>e},o.prototype.trim=function(){let e=this.words.length;for(;0<e&&0===this.words[e-1];)e--;this.words=this.words.slice(0,e)},o.prototype.resize=function(e){for(let t=this.words.length;t<e+32>>>5;t++)this.words[t]=0},o.prototype.hammingWeight=function(e){return e-=1431655765&e>>>1,e=(858993459&e)+(858993459&e>>>2),16843009*(252645135&e+(e>>>4))>>>24},o.prototype.hammingWeight4=function(e,t,n,r){return e-=1431655765&e>>>1,t-=1431655765&t>>>1,n-=1431655765&n>>>1,r-=1431655765&r>>>1,e=(858993459&e)+(858993459&e>>>2),t=(858993459&t)+(858993459&t>>>2),n=(858993459&n)+(858993459&n>>>2),r=(858993459&r)+(858993459&r>>>2),e=252645135&e+(e>>>4),t=252645135&t+(t>>>4),n=252645135&n+(n>>>4),r=252645135&r+(r>>>4),16843009*(e+t+n+r)>>>24},o.prototype.size=function(){let e=0;const t=this.words.length,n=this.words;for(let r=0;r<t;r++)e+=this.hammingWeight(n[r]);return e},o.prototype.array=function(){const e=Array(this.size());let n=0;const r=this.words.length;for(let o=0,i;o<r;++o)for(i=this.words[o];0!=i;){const r=i&-i;e[n++]=(o<<5)+this.hammingWeight(0|r-1),i^=r}return e},o.prototype.forEach=function(e){const t=this.words.length;for(let n=0,r;n<t;++n)for(r=this.words[n];0!=r;){const o=r&-r;e((n<<5)+this.hammingWeight(0|o-1)),r^=o}},o.prototype[Symbol.iterator]=function*(){const e=this.words.length;for(let n=0,r;n<e;++n)for(r=this.words[n];0!=r;){const e=r&-r;yield(n<<5)+this.hammingWeight(0|e-1),r^=e}},o.prototype.clone=function(){const e=Object.create(o.prototype);return e.words=this.words.slice(),e},o.prototype.intersects=function(e){const t=n(this.words.length,e.words.length);for(let n=0;n<t;++n)if(0!=(this.words[n]&e.words[n]))return!0;return!1},o.prototype.intersection=function(e){const t=n(this.words.length,e.words.length);let r=0;for(;r+7<t;r+=8)this.words[r]&=e.words[r],this.words[r+1]&=e.words[r+1],this.words[r+2]&=e.words[r+2],this.words[r+3]&=e.words[r+3],this.words[r+4]&=e.words[r+4],this.words[r+5]&=e.words[r+5],this.words[r+6]&=e.words[r+6],this.words[r+7]&=e.words[r+7];for(;r<t;++r)this.words[r]&=e.words[r];const o=this.words.length;for(r=t;r<o;++r)this.words[r]=0;return this},o.prototype.intersection_size=function(e){const t=n(this.words.length,e.words.length);let r=0;for(let n=0;n<t;++n)r+=this.hammingWeight(this.words[n]&e.words[n]);return r},o.prototype.new_intersection=function(e){const t=Object.create(o.prototype),r=n(this.words.length,e.words.length);t.words=Array(r);let i=0;for(;i+7<r;i+=8)t.words[i]=this.words[i]&e.words[i],t.words[i+1]=this.words[i+1]&e.words[i+1],t.words[i+2]=this.words[i+2]&e.words[i+2],t.words[i+3]=this.words[i+3]&e.words[i+3],t.words[i+4]=this.words[i+4]&e.words[i+4],t.words[i+5]=this.words[i+5]&e.words[i+5],t.words[i+6]=this.words[i+6]&e.words[i+6],t.words[i+7]=this.words[i+7]&e.words[i+7];for(;i<r;++i)t.words[i]=this.words[i]&e.words[i];return t},o.prototype.equals=function(e){const t=n(this.words.length,e.words.length);for(let n=0;n<t;++n)if(this.words[n]!=e.words[n])return!1;if(this.words.length<e.words.length){const t=e.words.length;for(let n=this.words.length;n<t;++n)if(0!=e.words[n])return!1}else if(e.words.length<this.words.length){const t=this.words.length;for(let n=e.words.length;n<t;++n)if(0!=this.words[n])return!1}return!0},o.prototype.difference=function(e){const t=n(this.words.length,e.words.length);let r=0;for(;r+7<t;r+=8)this.words[r]&=~e.words[r],this.words[r+1]&=~e.words[r+1],this.words[r+2]&=~e.words[r+2],this.words[r+3]&=~e.words[r+3],this.words[r+4]&=~e.words[r+4],this.words[r+5]&=~e.words[r+5],this.words[r+6]&=~e.words[r+6],this.words[r+7]&=~e.words[r+7];for(;r<t;++r)this.words[r]&=~e.words[r];return this},o.prototype.difference2=function(e){const t=n(this.words.length,e.words.length);let r=0;for(;r+7<t;r+=8)e.words[r]=this.words[r]&~e.words[r],e.words[r+1]=this.words[r+1]&~e.words[r+1],e.words[r+2]=this.words[r+2]&~e.words[r+2],e.words[r+3]=this.words[r+3]&~e.words[r+3],e.words[r+4]=this.words[r+4]&~e.words[r+4],e.words[r+5]=this.words[r+5]&~e.words[r+5],e.words[r+6]=this.words[r+6]&~e.words[r+6],e.words[r+7]=this.words[r+7]&~e.words[r+7];for(;r<t;++r)e.words[r]=this.words[r]&~e.words[r];for(r=this.words.length-1;r>=t;--r)e.words[r]=this.words[r];return e.words=e.words.slice(0,this.words.length),e},o.prototype.new_difference=function(e){return this.clone().difference(e)},o.prototype.difference_size=function(e){const t=n(this.words.length,e.words.length);let r=0,o=0;for(;o<t;++o)r+=this.hammingWeight(this.words[o]&~e.words[o]);for(const t=this.words.length;o<t;++o)r+=this.hammingWeight(this.words[o]);return r},o.prototype.change=function(e){const t=n(this.words.length,e.words.length);let r=0;for(;r+7<t;r+=8)this.words[r]^=e.words[r],this.words[r+1]^=e.words[r+1],this.words[r+2]^=e.words[r+2],this.words[r+3]^=e.words[r+3],this.words[r+4]^=e.words[r+4],this.words[r+5]^=e.words[r+5],this.words[r+6]^=e.words[r+6],this.words[r+7]^=e.words[r+7];for(;r<t;++r)this.words[r]^=e.words[r];for(r=e.words.length-1;r>=t;--r)this.words[r]=e.words[r];return this},o.prototype.new_change=function(e){const r=Object.create(o.prototype),i=t(this.words.length,e.words.length);r.words=Array(i);const d=n(this.words.length,e.words.length);let s=0;for(;s+7<d;s+=8)r.words[s]=this.words[s]^e.words[s],r.words[s+1]=this.words[s+1]^e.words[s+1],r.words[s+2]=this.words[s+2]^e.words[s+2],r.words[s+3]=this.words[s+3]^e.words[s+3],r.words[s+4]=this.words[s+4]^e.words[s+4],r.words[s+5]=this.words[s+5]^e.words[s+5],r.words[s+6]=this.words[s+6]^e.words[s+6],r.words[s+7]=this.words[s+7]^e.words[s+7];for(;s<d;++s)r.words[s]=this.words[s]^e.words[s];const a=this.words.length;for(s=d;s<a;++s)r.words[s]=this.words[s];const l=e.words.length;for(s=d;s<l;++s)r.words[s]=e.words[s];return r},o.prototype.change_size=function(e){const t=n(this.words.length,e.words.length);let r=0,o=0;for(;o<t;++o)r+=this.hammingWeight(this.words[o]^e.words[o]);const i=this.words.length>e.words.length?this:e,d=i.words.length;for(;o<d;++o)r+=this.hammingWeight(i.words[o]);return r},o.prototype.toString=function(){return"{"+this.array().join(",")+"}"},o.prototype.union=function(e){const t=n(this.words.length,e.words.length);let r=0;for(;r+7<t;r+=8)this.words[r]|=e.words[r],this.words[r+1]|=e.words[r+1],this.words[r+2]|=e.words[r+2],this.words[r+3]|=e.words[r+3],this.words[r+4]|=e.words[r+4],this.words[r+5]|=e.words[r+5],this.words[r+6]|=e.words[r+6],this.words[r+7]|=e.words[r+7];for(;r<t;++r)this.words[r]|=e.words[r];if(this.words.length<e.words.length){this.resize((e.words.length<<5)-1);const n=e.words.length;for(let r=t;r<n;++r)this.words[r]=e.words[r]}return this},o.prototype.new_union=function(e){const r=Object.create(o.prototype),i=t(this.words.length,e.words.length);r.words=Array(i);const d=n(this.words.length,e.words.length);let s=0;for(;s+7<d;s+=8)r.words[s]=this.words[s]|e.words[s],r.words[s+1]=this.words[s+1]|e.words[s+1],r.words[s+2]=this.words[s+2]|e.words[s+2],r.words[s+3]=this.words[s+3]|e.words[s+3],r.words[s+4]=this.words[s+4]|e.words[s+4],r.words[s+5]=this.words[s+5]|e.words[s+5],r.words[s+6]=this.words[s+6]|e.words[s+6],r.words[s+7]=this.words[s+7]|e.words[s+7];for(;s<d;++s)r.words[s]=this.words[s]|e.words[s];const a=this.words.length;for(s=d;s<a;++s)r.words[s]=this.words[s];const l=e.words.length;for(s=d;s<l;++s)r.words[s]=e.words[s];return r},o.prototype.union_size=function(e){const t=n(this.words.length,e.words.length);let r=0;for(let n=0;n<t;++n)r+=this.hammingWeight(this.words[n]|e.words[n]);if(this.words.length<e.words.length){const t=e.words.length;for(let n=this.words.length;n<t;++n)r+=this.hammingWeight(0|e.words[n])}else{const t=this.words.length;for(let n=e.words.length;n<t;++n)r+=this.hammingWeight(0|this.words[n])}return r},r.exports=o},{}],4:[function(o,i,d){(function(o){(function(){/**
2 * @license
3 * Lodash <https://lodash.com/>
4 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>

Callers 11

rFunction · 0.70
EFunction · 0.70
irFunction · 0.70
frFunction · 0.70
brFunction · 0.70
BrFunction · 0.70
uoFunction · 0.70
CoFunction · 0.70
BoFunction · 0.70
uFunction · 0.70
itemsjs.min.jsFile · 0.70

Calls 6

hnFunction · 0.85
nextMethod · 0.80
forEachMethod · 0.80
sFunction · 0.70
rFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected