Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@thi.ng/arrays

Package Overview
Dependencies
Maintainers
1
Versions
190
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thi.ng/arrays - npm Package Compare versions

Comparing version 0.8.1 to 0.8.2

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

## [0.8.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.8.1...@thi.ng/arrays@0.8.2) (2020-11-24)
**Note:** Version bump only for package @thi.ng/arrays
## [0.8.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.8.0...@thi.ng/arrays@0.8.1) (2020-09-22)

@@ -8,0 +16,0 @@

2

fill-range.d.ts

@@ -24,3 +24,3 @@ /**

*/
export declare const fillRange: <T extends number[] | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array>(buf: T, index?: number, start?: number, end?: number, step?: number) => T;
export declare const fillRange: <T extends import("@thi.ng/api").NumericArray>(buf: T, index?: number, start?: number, end?: number, step?: number) => T;
//# sourceMappingURL=fill-range.d.ts.map

@@ -1,1 +0,1 @@

!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@thi.ng/compare"),require("@thi.ng/equiv"),require("@thi.ng/checks"),require("@thi.ng/errors"),require("@thi.ng/api"),require("@thi.ng/random")):"function"==typeof define&&define.amd?define(["exports","@thi.ng/compare","@thi.ng/equiv","@thi.ng/checks","@thi.ng/errors","@thi.ng/api","@thi.ng/random"],r):r(((e="undefined"!=typeof globalThis?globalThis:e||self).thi=e.thi||{},e.thi.ng=e.thi.ng||{},e.thi.ng.arrays={}),e.thi.ng.compare,e.thi.ng.equiv,e.thi.ng.checks,e.thi.ng.errors,e.thi.ng.api,e.thi.ng.random)}(this,(function(e,r,t,n,i,o,u){"use strict";const s=e=>((null==e||!e[Symbol.iterator])&&i.illegalArgs("value is not iterable: "+e),e),l=(e,r,n=t.equiv)=>{for(let t=e.length;--t>=0;)if(n(r,e[t]))return t;return-1};const h=(e,r)=>e===r,a=(e,r,t=1/0,n=h)=>{if(e===r)return 0;if(e.length>r.length){const t=e;e=r,r=t}let i=e.length,o=r.length;for(;i>0&&n(e[~-i],r[~-o]);)i--,o--;let u=0;for(;u<i&&n(e[u],r[u]);)u++;if(i-=u,o-=u,0===i||o<3)return o;let s,l,a,f,c,g,d,p,y,b,m,q,v,S=0;const k=(e,r,t,i,o)=>e<r||t<r?e>t?t+1:e+1:n(o,i)?r:r+1,w=[];for(s=0;s<i;s++)w.push(s+1,e[u+s]);const A=w.length-1,T=o-3;for(;S<T;){for(b=r[u+(a=S)],m=r[u+(f=S+1)],q=r[u+(c=S+2)],v=r[u+(g=S+3)],d=S+=4,l=1/0,s=0;s<A;s+=2)p=w[s],y=w[s+1],a=k(p,a,f,b,y),f=k(a,f,c,m,y),c=k(f,c,g,q,y),d=k(c,g,d,v,y),d<l&&(l=d),w[s]=d,g=c,c=f,f=a,a=p;if(l>t)return 1/0}for(;S<o;){for(b=r[u+(a=S)],d=++S,l=1/0,s=0;s<A;s+=2)p=w[s],w[s]=d=k(p,a,d,b,w[s+1]),d<l&&(l=d),a=p;if(l>t)return 1/0}return d},f=(e,r,t)=>{const n=e[r];e[r]=e[t],e[t]=n};const c=(e,r=0,t=e.length,n=u.SYSTEM)=>{o.assert(r>=0&&t>=r&&t<=e.length,`illegal range ${r}..${t}`);let i=t-r;const s=i;if(s>1)for(;--i>=0;){const t=r+n.float(s)|0,i=r+n.float(s)|0,o=e[t];e[t]=e[i],e[i]=o}return e};e.arrayIterator=function*(e,r=0,t){if(!e)return;r=r,void 0===t&&(t=e.length);const n=r<=t?1:-1;for(;r!==t;r+=n)yield e[r]},e.binarySearch=(e,t,n=(e=>e),i=r.compare,o=0,u=e.length-1)=>{const s=n(t);for(;o<=u;){const r=o+u>>>1,t=i(n(e[r]),s);if(t<0)o=r+1;else{if(!(t>0))return r;u=r-1}}return-o-1},e.binarySearch16=(e,r)=>{let t=e[8]<=r?8:0;return t|=e[t+4]<=r?4:0,t|=e[t+2]<=r?2:0,t|=e[t+1]<=r?1:0,e[t]===r?t:-t-1},e.binarySearch32=(e,r)=>{let t=e[16]<=r?16:0;return t|=e[t+4]<=r?8:0,t|=e[t+4]<=r?4:0,t|=e[t+2]<=r?2:0,t|=e[t+1]<=r?1:0,e[t]===r?t:-t-1},e.binarySearch4=(e,r)=>{let t=e[2]<=r?2:0;return t|=e[t+1]<=r?1:0,e[t]===r?t:-t-1},e.binarySearch8=(e,r)=>{let t=e[4]<=r?4:0;return t|=e[t+2]<=r?2:0,t|=e[t+1]<=r?1:0,e[t]===r?t:-t-1},e.binarySearchNumeric=(e,t,n=r.compareNumAsc,i=0,o=e.length-1)=>{for(;i<=o;){const r=i+o>>>1,u=n(e[r],t);if(u<0)i=r+1;else{if(!(u>0))return r;o=r-1}}return-i-1},e.bsEQ=e=>e<0?-1:e,e.bsGE=(e,r)=>(e=e<0?-e-1:e)<r?e:-1,e.bsGT=(e,r)=>(e=e<0?-e-1:e+1)<r?e:-1,e.bsLE=e=>e<0?-e-2:e,e.bsLT=e=>e<0?-e-2:e-1,e.endsWith=(e,r,n=t.equiv)=>{let i=e.length,o=r.length;if(i<o)return!1;for(;--i,--o>=0&&n(e[i],r[o]););return o<0},e.ensureArray=e=>n.isArray(e)?e:[...s(e)],e.ensureArrayLike=e=>n.isArrayLike(e)?e:[...s(e)],e.ensureIterable=s,e.fillRange=(e,r=0,t=0,n=e.length,i=(n>t?1:-1))=>{if(i>0)for(;t<n;t+=i)e[r++]=t;else for(;t>n;t+=i)e[r++]=t;return e},e.find=(e,r,n=t.equiv)=>{const i=l(e,r,n);return-1!==i?e[i]:void 0},e.findIndex=l,e.first=e=>e[0],e.fuzzyMatch=(e,r,n=t.equiv)=>{const i=e.length,o=r.length;if(o>i)return!1;if(o===i)return n(r,e);e:for(let t=0,u=0;t<o;t++){const o=r[t];for(;u<i;)if(n(e[u++],o))continue e;return!1}return!0},e.isSorted=(e,t=r.compare,n=0,i=e.length)=>{let o=e[n];for(;++n<i;){const r=e[n];if(t(o,r)>0)return!1;o=r}return!0},e.levenshtein=a,e.multiSwap=(...e)=>{const[r,t,n]=e,i=e.length;switch(i){case 0:return f;case 1:return(e,t,n)=>{f(e,t,n),f(r,t,n)};case 2:return(e,n,i)=>{f(e,n,i),f(r,n,i),f(t,n,i)};case 3:return(e,i,o)=>{f(e,i,o),f(r,i,o),f(t,i,o),f(n,i,o)};default:return(r,t,n)=>{f(r,t,n);for(let r=i;--r>=0;)f(e[r],t,n)}}},e.normalizedLevenshtein=(e,r,t=1/0,n=h)=>{const i=Math.max(e.length,r.length);return i>0?a(e,r,t,n)/i:0},e.peek=e=>e[e.length-1],e.quickSort=function e(t,n=r.compare,i=f,o=0,u=t.length-1){if(o<u){const r=t[o+(u-o>>1)];let s=o-1,l=u+1;for(;;){do{s++}while(n(t[s],r)<0);do{l--}while(n(t[l],r)>0);if(s>=l)break;i(t,s,l)}e(t,n,i,o,l),e(t,n,i,l+1,u)}return t},e.shuffle=(e,r=e.length,t=u.SYSTEM)=>c(e,0,r,t),e.shuffleRange=c,e.startsWith=(e,r,n=t.equiv)=>{let i=e.length,o=r.length;if(i<o)return!1;for(;-o>=0&&n(e[o],r[o]););return o<0},e.swap=f,e.swizzle=e=>{const[r,t,n,i,o,u,s,l]=e;switch(e.length){case 0:return()=>[];case 1:return e=>[e[r]];case 2:return e=>[e[r],e[t]];case 3:return e=>[e[r],e[t],e[n]];case 4:return e=>[e[r],e[t],e[n],e[i]];case 5:return e=>[e[r],e[t],e[n],e[i],e[o]];case 6:return e=>[e[r],e[t],e[n],e[i],e[o],e[u]];case 7:return e=>[e[r],e[t],e[n],e[i],e[o],e[u],e[s]];case 8:return e=>[e[r],e[t],e[n],e[i],e[o],e[u],e[s],e[l]];default:return r=>{const t=[];for(let n=e.length;--n>=0;)t[n]=r[e[n]];return t}}},Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@thi.ng/compare"),require("@thi.ng/equiv"),require("@thi.ng/checks"),require("@thi.ng/errors"),require("@thi.ng/api"),require("@thi.ng/random")):"function"==typeof define&&define.amd?define(["exports","@thi.ng/compare","@thi.ng/equiv","@thi.ng/checks","@thi.ng/errors","@thi.ng/api","@thi.ng/random"],r):r(((e="undefined"!=typeof globalThis?globalThis:e||self).thi=e.thi||{},e.thi.ng=e.thi.ng||{},e.thi.ng.arrays={}),e.thi.ng.compare,e.thi.ng.equiv,e.thi.ng.checks,e.thi.ng.errors,e.thi.ng.api,e.thi.ng.random)}(this,(function(e,r,t,n,i,o,u){"use strict";const s=e=>((null==e||!e[Symbol.iterator])&&i.illegalArgs(`value is not iterable: ${e}`),e),l=(e,r,n=t.equiv)=>{for(let t=e.length;--t>=0;)if(n(r,e[t]))return t;return-1};const h=(e,r)=>e===r,a=(e,r,t=1/0,n=h)=>{if(e===r)return 0;if(e.length>r.length){const t=e;e=r,r=t}let i=e.length,o=r.length;for(;i>0&&n(e[~-i],r[~-o]);)i--,o--;let u=0;for(;u<i&&n(e[u],r[u]);)u++;if(i-=u,o-=u,0===i||o<3)return o;let s,l,a,f,c,g,d,p,y,b,m,q,v,S=0;const k=(e,r,t,i,o)=>e<r||t<r?e>t?t+1:e+1:n(o,i)?r:r+1,w=[];for(s=0;s<i;s++)w.push(s+1,e[u+s]);const A=w.length-1,T=o-3;for(;S<T;){for(b=r[u+(a=S)],m=r[u+(f=S+1)],q=r[u+(c=S+2)],v=r[u+(g=S+3)],d=S+=4,l=1/0,s=0;s<A;s+=2)p=w[s],y=w[s+1],a=k(p,a,f,b,y),f=k(a,f,c,m,y),c=k(f,c,g,q,y),d=k(c,g,d,v,y),d<l&&(l=d),w[s]=d,g=c,c=f,f=a,a=p;if(l>t)return 1/0}for(;S<o;){for(b=r[u+(a=S)],d=++S,l=1/0,s=0;s<A;s+=2)p=w[s],w[s]=d=k(p,a,d,b,w[s+1]),d<l&&(l=d),a=p;if(l>t)return 1/0}return d},f=(e,r,t)=>{const n=e[r];e[r]=e[t],e[t]=n};const c=(e,r=0,t=e.length,n=u.SYSTEM)=>{o.assert(r>=0&&t>=r&&t<=e.length,`illegal range ${r}..${t}`);let i=t-r;const s=i;if(s>1)for(;--i>=0;){const t=r+n.float(s)|0,i=r+n.float(s)|0,o=e[t];e[t]=e[i],e[i]=o}return e};e.arrayIterator=function*(e,r=0,t){if(!e)return;r=r,void 0===t&&(t=e.length);const n=r<=t?1:-1;for(;r!==t;r+=n)yield e[r]},e.binarySearch=(e,t,n=(e=>e),i=r.compare,o=0,u=e.length-1)=>{const s=n(t);for(;o<=u;){const r=o+u>>>1,t=i(n(e[r]),s);if(t<0)o=r+1;else{if(!(t>0))return r;u=r-1}}return-o-1},e.binarySearch16=(e,r)=>{let t=e[8]<=r?8:0;return t|=e[t+4]<=r?4:0,t|=e[t+2]<=r?2:0,t|=e[t+1]<=r?1:0,e[t]===r?t:-t-1},e.binarySearch32=(e,r)=>{let t=e[16]<=r?16:0;return t|=e[t+4]<=r?8:0,t|=e[t+4]<=r?4:0,t|=e[t+2]<=r?2:0,t|=e[t+1]<=r?1:0,e[t]===r?t:-t-1},e.binarySearch4=(e,r)=>{let t=e[2]<=r?2:0;return t|=e[t+1]<=r?1:0,e[t]===r?t:-t-1},e.binarySearch8=(e,r)=>{let t=e[4]<=r?4:0;return t|=e[t+2]<=r?2:0,t|=e[t+1]<=r?1:0,e[t]===r?t:-t-1},e.binarySearchNumeric=(e,t,n=r.compareNumAsc,i=0,o=e.length-1)=>{for(;i<=o;){const r=i+o>>>1,u=n(e[r],t);if(u<0)i=r+1;else{if(!(u>0))return r;o=r-1}}return-i-1},e.bsEQ=e=>e<0?-1:e,e.bsGE=(e,r)=>(e=e<0?-e-1:e)<r?e:-1,e.bsGT=(e,r)=>(e=e<0?-e-1:e+1)<r?e:-1,e.bsLE=e=>e<0?-e-2:e,e.bsLT=e=>e<0?-e-2:e-1,e.endsWith=(e,r,n=t.equiv)=>{let i=e.length,o=r.length;if(i<o)return!1;for(;--i,--o>=0&&n(e[i],r[o]););return o<0},e.ensureArray=e=>n.isArray(e)?e:[...s(e)],e.ensureArrayLike=e=>n.isArrayLike(e)?e:[...s(e)],e.ensureIterable=s,e.fillRange=(e,r=0,t=0,n=e.length,i=(n>t?1:-1))=>{if(i>0)for(;t<n;t+=i)e[r++]=t;else for(;t>n;t+=i)e[r++]=t;return e},e.find=(e,r,n=t.equiv)=>{const i=l(e,r,n);return-1!==i?e[i]:void 0},e.findIndex=l,e.first=e=>e[0],e.fuzzyMatch=(e,r,n=t.equiv)=>{const i=e.length,o=r.length;if(o>i)return!1;if(o===i)return n(r,e);e:for(let t=0,u=0;t<o;t++){const o=r[t];for(;u<i;)if(n(e[u++],o))continue e;return!1}return!0},e.isSorted=(e,t=r.compare,n=0,i=e.length)=>{let o=e[n];for(;++n<i;){const r=e[n];if(t(o,r)>0)return!1;o=r}return!0},e.levenshtein=a,e.multiSwap=(...e)=>{const[r,t,n]=e,i=e.length;switch(i){case 0:return f;case 1:return(e,t,n)=>{f(e,t,n),f(r,t,n)};case 2:return(e,n,i)=>{f(e,n,i),f(r,n,i),f(t,n,i)};case 3:return(e,i,o)=>{f(e,i,o),f(r,i,o),f(t,i,o),f(n,i,o)};default:return(r,t,n)=>{f(r,t,n);for(let r=i;--r>=0;)f(e[r],t,n)}}},e.normalizedLevenshtein=(e,r,t=1/0,n=h)=>{const i=Math.max(e.length,r.length);return i>0?a(e,r,t,n)/i:0},e.peek=e=>e[e.length-1],e.quickSort=function e(t,n=r.compare,i=f,o=0,u=t.length-1){if(o<u){const r=t[o+(u-o>>1)];let s=o-1,l=u+1;for(;;){do{s++}while(n(t[s],r)<0);do{l--}while(n(t[l],r)>0);if(s>=l)break;i(t,s,l)}e(t,n,i,o,l),e(t,n,i,l+1,u)}return t},e.shuffle=(e,r=e.length,t=u.SYSTEM)=>c(e,0,r,t),e.shuffleRange=c,e.startsWith=(e,r,n=t.equiv)=>{let i=e.length,o=r.length;if(i<o)return!1;for(;-o>=0&&n(e[o],r[o]););return o<0},e.swap=f,e.swizzle=e=>{const[r,t,n,i,o,u,s,l]=e;switch(e.length){case 0:return()=>[];case 1:return e=>[e[r]];case 2:return e=>[e[r],e[t]];case 3:return e=>[e[r],e[t],e[n]];case 4:return e=>[e[r],e[t],e[n],e[i]];case 5:return e=>[e[r],e[t],e[n],e[i],e[o]];case 6:return e=>[e[r],e[t],e[n],e[i],e[o],e[u]];case 7:return e=>[e[r],e[t],e[n],e[i],e[o],e[u],e[s]];case 8:return e=>[e[r],e[t],e[n],e[i],e[o],e[u],e[s],e[l]];default:return r=>{const t=[];for(let n=e.length;--n>=0;)t[n]=r[e[n]];return t}}},Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "@thi.ng/arrays",
"version": "0.8.1",
"version": "0.8.2",
"description": "Array / Arraylike utilities",

@@ -42,18 +42,18 @@ "module": "./index.js",

"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/api-extractor": "^7.12.0",
"@types/mocha": "^8.0.3",
"@types/node": "^14.6.1",
"mocha": "^8.1.2",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
"ts-node": "^9.0.0",
"typedoc": "^0.18.0",
"typescript": "^4.0.2"
"typedoc": "^0.19.2",
"typescript": "^4.1.2"
},
"dependencies": {
"@thi.ng/api": "^6.13.1",
"@thi.ng/checks": "^2.7.9",
"@thi.ng/compare": "^1.3.17",
"@thi.ng/equiv": "^1.0.32",
"@thi.ng/errors": "^1.2.22",
"@thi.ng/random": "^2.0.2"
"@thi.ng/api": "^6.13.2",
"@thi.ng/checks": "^2.7.10",
"@thi.ng/compare": "^1.3.18",
"@thi.ng/equiv": "^1.0.33",
"@thi.ng/errors": "^1.2.23",
"@thi.ng/random": "^2.1.0"
},

@@ -66,2 +66,3 @@ "files": [

"keywords": [
"aos",
"array",

@@ -82,3 +83,3 @@ "binary",

},
"gitHead": "130dff672b56f789205177c2243169d33d479948"
"gitHead": "3a89bdfa4c58983d5e005b3e9fb056b0351198fe"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc