Comparing version 0.0.12 to 0.0.13
@@ -100,3 +100,3 @@ import { a as H } from "./any-Cwhnkyrv.js"; | ||
} | ||
return t(n, []), o; | ||
return t([...n], []), o; | ||
} | ||
@@ -103,0 +103,0 @@ function $(n, o) { |
@@ -8,2 +8,2 @@ /** | ||
*/ | ||
export default function all<T>(array: T[]): boolean; | ||
export default function all<T>(array: ReadonlyArray<T>): boolean; |
@@ -8,2 +8,2 @@ /** | ||
*/ | ||
export default function any<T>(array: T[]): boolean; | ||
export default function any<T>(array: ReadonlyArray<T>): boolean; |
@@ -9,2 +9,2 @@ /** | ||
*/ | ||
export default function bubbleSort<T>(array: T[], compare: (a: T, b: T) => number): T[]; | ||
export default function bubbleSort<T>(array: ReadonlyArray<T>, compare: (a: T, b: T) => number): T[]; |
@@ -10,2 +10,2 @@ /** | ||
*/ | ||
export default function chunk<T>(array: T[], chunkSize: number): T[][]; | ||
export default function chunk<T>(array: ReadonlyArray<T>, chunkSize: number): T[][]; |
@@ -8,2 +8,2 @@ /** | ||
*/ | ||
export default function compact<T>(array: T[]): NonNullable<T>[]; | ||
export default function compact<T>(array: ReadonlyArray<T>): NonNullable<T>[]; |
@@ -9,2 +9,2 @@ /** | ||
*/ | ||
export default function heapSort<T>(array: T[], compare: (a: T, b: T) => number): T[]; | ||
export default function heapSort<T>(array: ReadonlyArray<T>, compare: (a: T, b: T) => number): T[]; |
@@ -9,2 +9,2 @@ /** | ||
*/ | ||
export default function insertionSort<T>(array: T[], compare: (a: T, b: T) => number): T[]; | ||
export default function insertionSort<T>(array: ReadonlyArray<T>, compare: (a: T, b: T) => number): T[]; |
@@ -9,2 +9,2 @@ /** | ||
*/ | ||
export default function intersection<T>(array1: T[], array2: T[]): T[]; | ||
export default function intersection<T>(array1: ReadonlyArray<T>, array2: ReadonlyArray<T>): T[]; |
@@ -10,2 +10,2 @@ export declare function merge<T>(arr: T[], l: number, m: number, r: number, compare: (a: T, b: T) => number): void; | ||
*/ | ||
export default function mergeSort<T>(array: T[], compare: (a: T, b: T) => number): T[]; | ||
export default function mergeSort<T>(array: ReadonlyArray<T>, compare: (a: T, b: T) => number): T[]; |
@@ -11,2 +11,2 @@ /** | ||
*/ | ||
export default function partition<T>(array: T[], callback: (element: T) => boolean): [T[], T[]]; | ||
export default function partition<T>(array: ReadonlyArray<T>, callback: (element: T) => boolean): [T[], T[]]; |
@@ -9,2 +9,2 @@ /** | ||
*/ | ||
export default function permutations<T>(array: T[]): T[][]; | ||
export default function permutations<T>(array: ReadonlyArray<T>): T[][]; |
@@ -9,2 +9,2 @@ /** | ||
*/ | ||
export default function quickSort<T>(array: T[], compare: (a: T, b: T) => number): T[]; | ||
export default function quickSort<T>(array: ReadonlyArray<T>, compare: (a: T, b: T) => number): T[]; |
@@ -10,2 +10,2 @@ /** | ||
*/ | ||
export default function sample<T>(array: T[], count?: number): T[]; | ||
export default function sample<T>(array: ReadonlyArray<T>, count?: number): T[]; |
@@ -9,2 +9,2 @@ /** | ||
*/ | ||
export default function selectionSort<T>(array: T[], compare: (a: T, b: T) => number): T[]; | ||
export default function selectionSort<T>(array: ReadonlyArray<T>, compare: (a: T, b: T) => number): T[]; |
@@ -9,2 +9,2 @@ /** | ||
*/ | ||
export default function shuffle<T>(array: T[]): T[]; | ||
export default function shuffle<T>(array: ReadonlyArray<T>): T[]; |
@@ -9,2 +9,2 @@ /** | ||
*/ | ||
export default function timSort<T>(array: T[], compare: (a: T, b: T) => number): T[]; | ||
export default function timSort<T>(array: ReadonlyArray<T>, compare: (a: T, b: T) => number): T[]; |
@@ -8,2 +8,2 @@ /** | ||
*/ | ||
export default function unique<T>(array: T[]): T[]; | ||
export default function unique<T>(array: ReadonlyArray<T>): T[]; |
154
dist/core.js
import { i as x } from "./is-date-BiE_y9vK.js"; | ||
import { a as o } from "./is-integer-CycwtTGU.js"; | ||
import { i as E } from "./is-integer-CycwtTGU.js"; | ||
function c(t, r) { | ||
const n = new URL(t); | ||
return Object.keys(r).forEach((e) => { | ||
n.searchParams.append(e, r[e].toString()); | ||
}), n.toString(); | ||
import { a as s } from "./is-integer-CycwtTGU.js"; | ||
import { i as L } from "./is-integer-CycwtTGU.js"; | ||
function p(t, n) { | ||
const r = new URL(t); | ||
return Object.keys(n).forEach((e) => { | ||
r.searchParams.append(e, n[e].toString()); | ||
}), r.toString(); | ||
} | ||
function a() { | ||
function m() { | ||
let t = 0; | ||
@@ -30,85 +30,121 @@ return { | ||
} | ||
function f(t) { | ||
function y(t) { | ||
return Array.isArray(t); | ||
} | ||
function l(t) { | ||
function b(t) { | ||
return typeof t == "bigint"; | ||
} | ||
function p(t) { | ||
function w(t) { | ||
return typeof t == "boolean"; | ||
} | ||
function h(t) { | ||
function d(t) { | ||
return t instanceof Error; | ||
} | ||
function m(t) { | ||
return o(t) && !Number.isInteger(t); | ||
function g(t) { | ||
return s(t) && !Number.isInteger(t); | ||
} | ||
function y(t) { | ||
function j(t) { | ||
return typeof t == "function"; | ||
} | ||
function b(t) { | ||
function c(t) { | ||
return t === null; | ||
} | ||
function g(t) { | ||
function I(t) { | ||
return typeof t == "object" && t !== null && t.constructor.name === "Object"; | ||
} | ||
function i(t) { | ||
function a(t) { | ||
return Object.prototype.toString.call(t).slice(8, -1).toLowerCase(); | ||
} | ||
function d(t) { | ||
return i(t) === "string"; | ||
function S(t) { | ||
return a(t) === "string"; | ||
} | ||
function I(t) { | ||
function U(t) { | ||
return typeof t == "symbol"; | ||
} | ||
function U(t) { | ||
function f(t) { | ||
return typeof t > "u"; | ||
} | ||
function j(t) { | ||
const r = new URL(t); | ||
function E(t) { | ||
const n = /* @__PURE__ */ new Map(); | ||
return function(...r) { | ||
const e = Array.from(r).map((i) => `${c(i) ? "null" : f(i) ? "undefined" : JSON.stringify(i)}`).join("|"); | ||
if (n.has(e)) | ||
return n.get(e); | ||
const o = t(...r); | ||
return n.set(e, o), o; | ||
}; | ||
} | ||
function O(t) { | ||
const n = new URL(t); | ||
return { | ||
href: r.href, | ||
protocol: r.protocol, | ||
host: r.host, | ||
hostname: r.hostname, | ||
port: r.port, | ||
pathname: r.pathname, | ||
search: r.search, | ||
searchParams: [...r.searchParams], | ||
hash: r.hash, | ||
origin: r.origin | ||
href: n.href, | ||
protocol: n.protocol, | ||
host: n.host, | ||
hostname: n.hostname, | ||
port: n.port, | ||
pathname: n.pathname, | ||
search: n.search, | ||
searchParams: [...n.searchParams], | ||
hash: n.hash, | ||
origin: n.origin | ||
}; | ||
} | ||
function S(t, r) { | ||
let n = null; | ||
async function l(t) { | ||
return new Promise((n) => setTimeout(n, t)); | ||
} | ||
function T(t, n = 3, r = 1e3) { | ||
if (n < 1) throw new Error("Retries must be greater than 0."); | ||
return async function(...e) { | ||
for (let o = 0; o < n; o++) | ||
try { | ||
return await t(...e); | ||
} catch (i) { | ||
if (o === n - 1) | ||
throw i; | ||
await l(r); | ||
} | ||
throw new Error("This should never happen."); | ||
}; | ||
} | ||
function A(t, n) { | ||
let r = null; | ||
return { start: () => { | ||
n || (n = setInterval(t, r)); | ||
r || (r = setInterval(t, n)); | ||
}, stop: () => { | ||
n && (clearInterval(n), n = null); | ||
r && (clearInterval(r), r = null); | ||
} }; | ||
} | ||
async function w(t) { | ||
return new Promise((r) => setTimeout(r, t)); | ||
function N(t, n) { | ||
let r = 0, e = null; | ||
return function(...o) { | ||
const i = Date.now(), u = () => { | ||
r = i, t(...o); | ||
}; | ||
e && clearTimeout(e), i - r >= n ? u() : e = setTimeout(u, n - (i - r)); | ||
}; | ||
} | ||
export { | ||
c as buildUrl, | ||
a as createCounter, | ||
f as isArray, | ||
l as isBigInt, | ||
p as isBoolean, | ||
p as buildUrl, | ||
m as createCounter, | ||
y as isArray, | ||
b as isBigInt, | ||
w as isBoolean, | ||
x as isDate, | ||
h as isError, | ||
m as isFloat, | ||
y as isFunction, | ||
E as isInteger, | ||
b as isNull, | ||
o as isNumber, | ||
g as isObject, | ||
d as isString, | ||
I as isSymbol, | ||
U as isUndefined, | ||
j as parseUrl, | ||
S as scheduler, | ||
w as sleep, | ||
i as toType | ||
d as isError, | ||
g as isFloat, | ||
j as isFunction, | ||
L as isInteger, | ||
c as isNull, | ||
s as isNumber, | ||
I as isObject, | ||
S as isString, | ||
U as isSymbol, | ||
f as isUndefined, | ||
E as memoize, | ||
O as parseUrl, | ||
T as retry, | ||
A as scheduler, | ||
l as sleep, | ||
N as throttle, | ||
a as toType | ||
}; |
@@ -17,5 +17,8 @@ export { default as buildUrl } from './build-url/build-url'; | ||
export { default as isUndefined } from './is-undefined/is-undefined'; | ||
export { default as memoize } from './memoize/memoize'; | ||
export { default as parseUrl } from './parse-url/parse-url'; | ||
export { default as retry } from './retry/retry'; | ||
export { default as scheduler } from './scheduler/scheduler'; | ||
export { default as sleep } from './sleep/sleep'; | ||
export { default as throttle } from './throttle/throttle'; | ||
export { default as toType } from './to-type/to-type'; |
export { all, any, bubbleSort, chunk, compact, heapSort, insertionSort, intersection, mergeSort, partition, permutations, quickSort, range, sample, selectionSort, shuffle, timSort, unique, } from './array/index'; | ||
export { buildUrl, createCounter, isArray, isBigInt, isBoolean, isDate, isError, isFloat, isFunction, isInteger, isNull, isNumber, isObject, isString, isSymbol, isUndefined, parseUrl, scheduler, sleep, toType, } from './core/index'; | ||
export { buildUrl, createCounter, isArray, isBigInt, isBoolean, isDate, isError, isFloat, isFunction, isInteger, isNull, isNumber, isObject, isString, isSymbol, isUndefined, memoize, parseUrl, retry, scheduler, sleep, throttle, toType, } from './core/index'; | ||
export { age, dateCalculator, isLeapYear, isWeekend } from './date/index'; | ||
@@ -4,0 +4,0 @@ export { binomial, factorial, gcd, hypergeometric, iqr, lerp, mean, median, mode, nCr, nPr, poisson, q1, q2, q3, q4, rotateMatrix, std, sum, variance, } from './math/index'; |
import { all as o, bubbleSort as t, chunk as i, compact as a, heapSort as s, insertionSort as n, intersection as m, mergeSort as l, partition as p, permutations as c, quickSort as u, range as f, sample as d, selectionSort as x, shuffle as b, timSort as S, unique as g } from "./array.js"; | ||
import { a as h } from "./any-Cwhnkyrv.js"; | ||
import { buildUrl as U, createCounter as k, isArray as C, isBigInt as I, isBoolean as v, isError as A, isFloat as B, isFunction as D, isNull as F, isObject as N, isString as P, isSymbol as T, isUndefined as j, parseUrl as E, scheduler as L, sleep as M, toType as O } from "./core.js"; | ||
import { i as W } from "./is-date-BiE_y9vK.js"; | ||
import { i as w, a as z } from "./is-integer-CycwtTGU.js"; | ||
import { age as H, dateCalculator as J, isLeapYear as K, isWeekend as Q } from "./date.js"; | ||
import { binomial as X, factorial as Z, gcd as _, hypergeometric as $, iqr as ee, lerp as re, mean as oe, median as te, mode as ie, nCr as ae, nPr as se, poisson as ne, q1 as me, q2 as le, q3 as pe, q4 as ce, rotateMatrix as ue, std as fe, sum as de, variance as xe } from "./math.js"; | ||
import { isUUID as Se, numberToRoman as ge, replaceAll as qe, reverse as he, truncate as ye } from "./string.js"; | ||
import { measurePerformance as ke } from "./system.js"; | ||
import { buildUrl as U, createCounter as k, isArray as C, isBigInt as I, isBoolean as v, isError as A, isFloat as B, isFunction as D, isNull as F, isObject as N, isString as P, isSymbol as T, isUndefined as j, memoize as z, parseUrl as E, retry as L, scheduler as M, sleep as O, throttle as R, toType as W } from "./core.js"; | ||
import { i as w } from "./is-date-BiE_y9vK.js"; | ||
import { i as H, a as J } from "./is-integer-CycwtTGU.js"; | ||
import { age as Q, dateCalculator as V, isLeapYear as X, isWeekend as Z } from "./date.js"; | ||
import { binomial as $, factorial as ee, gcd as re, hypergeometric as oe, iqr as te, lerp as ie, mean as ae, median as se, mode as ne, nCr as me, nPr as le, poisson as pe, q1 as ce, q2 as ue, q3 as fe, q4 as de, rotateMatrix as xe, std as be, sum as Se, variance as ge } from "./math.js"; | ||
import { isUUID as he, numberToRoman as ye, replaceAll as Ue, reverse as ke, truncate as Ce } from "./string.js"; | ||
import { measurePerformance as ve } from "./system.js"; | ||
export { | ||
H as age, | ||
Q as age, | ||
o as all, | ||
h as any, | ||
X as binomial, | ||
$ as binomial, | ||
t as bubbleSort, | ||
@@ -20,61 +20,64 @@ U as buildUrl, | ||
k as createCounter, | ||
J as dateCalculator, | ||
Z as factorial, | ||
_ as gcd, | ||
V as dateCalculator, | ||
ee as factorial, | ||
re as gcd, | ||
s as heapSort, | ||
$ as hypergeometric, | ||
oe as hypergeometric, | ||
n as insertionSort, | ||
m as intersection, | ||
ee as iqr, | ||
te as iqr, | ||
C as isArray, | ||
I as isBigInt, | ||
v as isBoolean, | ||
W as isDate, | ||
w as isDate, | ||
A as isError, | ||
B as isFloat, | ||
D as isFunction, | ||
w as isInteger, | ||
K as isLeapYear, | ||
H as isInteger, | ||
X as isLeapYear, | ||
F as isNull, | ||
z as isNumber, | ||
J as isNumber, | ||
N as isObject, | ||
P as isString, | ||
T as isSymbol, | ||
Se as isUUID, | ||
he as isUUID, | ||
j as isUndefined, | ||
Q as isWeekend, | ||
re as lerp, | ||
oe as mean, | ||
ke as measurePerformance, | ||
te as median, | ||
Z as isWeekend, | ||
ie as lerp, | ||
ae as mean, | ||
ve as measurePerformance, | ||
se as median, | ||
z as memoize, | ||
l as mergeSort, | ||
ie as mode, | ||
ae as nCr, | ||
se as nPr, | ||
ge as numberToRoman, | ||
ne as mode, | ||
me as nCr, | ||
le as nPr, | ||
ye as numberToRoman, | ||
E as parseUrl, | ||
p as partition, | ||
c as permutations, | ||
ne as poisson, | ||
me as q1, | ||
le as q2, | ||
pe as q3, | ||
ce as q4, | ||
pe as poisson, | ||
ce as q1, | ||
ue as q2, | ||
fe as q3, | ||
de as q4, | ||
u as quickSort, | ||
f as range, | ||
qe as replaceAll, | ||
he as reverse, | ||
ue as rotateMatrix, | ||
Ue as replaceAll, | ||
L as retry, | ||
ke as reverse, | ||
xe as rotateMatrix, | ||
d as sample, | ||
L as scheduler, | ||
M as scheduler, | ||
x as selectionSort, | ||
b as shuffle, | ||
M as sleep, | ||
fe as std, | ||
de as sum, | ||
O as sleep, | ||
be as std, | ||
Se as sum, | ||
R as throttle, | ||
S as timSort, | ||
O as toType, | ||
ye as truncate, | ||
W as toType, | ||
Ce as truncate, | ||
g as unique, | ||
xe as variance | ||
ge as variance | ||
}; |
@@ -62,3 +62,3 @@ { | ||
"types": "./dist/index.d.ts", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"scripts": { | ||
@@ -68,3 +68,4 @@ "dev": "vite", | ||
"preview": "vite preview", | ||
"test": "vitest" | ||
"test": "vitest", | ||
"format": "prettier --write ." | ||
}, | ||
@@ -71,0 +72,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
71219
98
1516
0