tsu 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +33 -3
- package/dist/index.d.ts +33 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var U=(n,e)=>{for(var t in e)a(n,t,{get:e[t],enumerable:!0})},A=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of k(e))!N.call(n,o)&&o!==t&&a(n,o,{get:()=>e[o],enumerable:!(r=O(e,o))||r.enumerable});return n};var M=n=>A(a({},"__esModule",{value:!0}),n);var An={};U(An,{capitalise:()=>gn,ceil:()=>F,chars:()=>yn,clamp:()=>S,clone:()=>y,debounce:()=>an,deepMerge:()=>v,drop:()=>P,floor:()=>E,groupsOf:()=>W,head:()=>H,init:()=>_,isArray:()=>c,isBlank:()=>hn,isBoolean:()=>X,isBrowser:()=>h,isDefined:()=>nn,isEmpty:()=>wn,isEmptyObject:()=>en,isEven:()=>C,isFunction:()=>tn,isNull:()=>rn,isNumber:()=>p,isObject:()=>l,isOdd:()=>q,isString:()=>f,isTouchDevice:()=>on,isWindow:()=>un,last:()=>$,max:()=>I,memoize:()=>mn,min:()=>V,noop:()=>dn,once:()=>pn,partition:()=>z,product:()=>B,randomChance:()=>R,randomNumber:()=>s,range:()=>J,round:()=>D,scroll:()=>ln,shuffle:()=>K,sleep:()=>xn,splitAt:()=>Y,splitStrAt:()=>vn,sum:()=>L,tail:()=>Z,take:()=>G,throttle:()=>bn,toArray:()=>Q,toCamel:()=>jn,toKebab:()=>On,toNumber:()=>kn,toOrdinal:()=>Nn,truncate:()=>Un,uniq:()=>m,uuid:()=>Tn});module.exports=M(An);function F(n,e=1){let t=n/e;return Math.ceil(t)*e}function S(n,e,t){return Math.min(t,Math.max(e,n))}function E(n,e=1){let t=n/e;return Math.floor(t)*e}function C(n){return n%2===0}function q(n){return n%2!==0}function I(n){if(n.length)return Math.max(...n)}function V(n){if(n.length)return Math.min(...n)}function B(n){let e=1;for(let t=0;t<n.length;t++)e*=n[t];return e}function R(n){return s(n)===0}function s(...n){let e,t;return n.length===1?(e=0,t=n[0]):(e=n[0],t=n[1]),Math.floor(Math.random()*(t-e))+e}function D(n,e=1){let t=n/e;return Math.round(t)*e}function L(n){let e=0;for(let t=0;t<n.length;t++)e+=n[t];return e}function y(n){if(n.length===0)return[];let e=[];for(let t=0;t<n.length;t++)e[t]=n[t];return e}function P(n,e){return n<=0?[...e]:e.slice(n)}function W(n,e){if(n<=0)throw new Error("[tsu] Invalid group size. Is it greater than 0?");if(n>=e.length)return[[...e]];let t=[];for(let r=0;r<e.length;r+=n)t.push(e.slice(r,r+n));return t}function H(n){return n[0]}function _(n){return n.slice(0,n.length-1)}function $(n){return n[n.length-1]}function z(n,e){let t=[],r=[];for(let o=0;o<n.length;o++){let u=n[o];e(u,o,n)?t.push(u):r.push(u)}return[t,r]}function J(...n){let e,t,r;n.length===1?(t=n[0],e=0,r=1):(e=n[0],t=n[1],r=n[2]||1),r<=0&&(console.warn("[tsu] warning: a step less than or equal to 0 will be set to 1."),r=1);let o=[],u=e;for(;u<t;)o.push(u),u+=r||1;return o}function K(n){let e=y(n),t,r,o;for(t=e.length;t;t-=1)r=s(t),o=e[t-1],e[t-1]=e[r],e[r]=o;return e}function Y(n,e){return n<=0?[[],[...e]]:n>e.length?[[...e],[]]:[e.slice(0,n),e.slice(n)]}function Z(n){return n.slice(1)}function G(n,e){return n<=0?[]:e.slice(0,n)}function Q(n){return n?Array.isArray(n)?n:[n]:[]}function m(n){return Array.from(new Set(n))}function c(n){return Array.isArray(n)}function X(n){return typeof n=="boolean"}function h(){return typeof window<"u"}function nn(n){return typeof n<"u"}function en(n){if(!l(n))return!1;for(let e in n)return!1;return!0}function tn(n){return typeof n=="function"}function rn(n){return Object.prototype.toString.call(n)==="[object Null]"}function p(n){return typeof n=="number"}function l(n){return Object.prototype.toString.call(n)==="[object Object]"}function f(n){return typeof n=="string"}function on(){return"ontouchstart"in window||navigator.maxTouchPoints>0}function un(n){return h()&&Object.prototype.toString.call(n)==="[object Window]"}function ln({to:n,offset:e=0,duration:t=1e3,container:r=null}){let o=f(n)?document.querySelector(n):n,u=f(r)?document.querySelector(r):r,i=u?.scrollTop||window?.pageYOffset||0,b=(p(o)?o:fn(o,i))+e,j=Date.now();function d(){let x=Date.now()-j,T=x<t,g=T?cn(i,b,x,t):b;T&&requestAnimationFrame(d),u?u.scrollTop=g:window.scrollTo(0,g)}d()}function sn(n){return n<.5?4*Math.pow(n,3):(n-1)*(2*n-2)*(2*n-2)+1}function cn(n,e,t,r){return n+(e-n)*sn(t/r)}function fn(n,e){return n.nodeName==="HTML"?-e:n.getBoundingClientRect().top+e}function an(n,e){e<0&&console.warn("[tsu] warning: a debounce delay less than 0ms will be treated as 0ms.");let t;return function(...r){clearTimeout(t),t=setTimeout(()=>{clearTimeout(t),n(...r)},e)}}function mn(n){let e={};return function(...t){let r=JSON.stringify(t);if(r in e)return e[r];let o=n(...t);return e[r]=o,o}}function pn(n){let e=!1;return(...t)=>{e||(n(...t),e=!0)}}function bn(n,e){e<0&&console.warn("[tsu] warning: a throttle limit less than 0ms will be treated as 0ms.");let t=!1;return function(...r){t||(n(...r),t=!0,setTimeout(()=>{t=!1},e))}}function dn(){}async function xn(n){return n<0&&console.warn("[tsu] warning: a sleep duration less than 0ms will be treated as 0ms."),new Promise(e=>{setTimeout(e,n)})}var w="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";function Tn(n=16){let e=w.length,t=n,r="";for(;t--;)r+=w[Math.random()*e|0];return r}function v(...n){let e={};for(let t=0;t<n.length;t++){let r=n[t],o=Object.keys(r);for(let u=0;u<o.length;u++){let i=o[u];c(e[i])&&c(r[i])?e[i]=m(e[i].concat(r[i])):l(e[i])&&l(r[i])?e[i]=v(e[i],r[i]):e[i]=r[i]}}return e}function gn(n,e=!1,t=" "){return e?n.split(t).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(t):n.charAt(0).toUpperCase()+n.slice(1)}function yn(n){return n.split("")}function hn(n){return n.trim().length===0}function wn(n){return n.length===0}function vn(n,e){return n<=0?["",e]:n>e.length?[e,""]:[e.slice(0,n),e.slice(n)]}function jn(n){let e=/-(\w)/g;return n.replace(e,(t,r)=>r?r.toUpperCase():"")}function On(n){let e=/\B([A-Z])/g;return n.replace(e,"-$1").toLowerCase()}function kn(n){return n.length?Number(n.replace(/[#£€$,%]/g,"")):NaN}function Nn(n){let t=["st","nd","rd"][(n/10%10^1&&n%10)-1]||"th";return`${n}${t}`}function Un(n,e,t="..."){return e<=0?t:n.slice(0,e)+t}0&&(module.exports={capitalise,ceil,chars,clamp,clone,debounce,deepMerge,drop,floor,groupsOf,head,init,isArray,isBlank,isBoolean,isBrowser,isDefined,isEmpty,isEmptyObject,isEven,isFunction,isNull,isNumber,isObject,isOdd,isString,isTouchDevice,isWindow,last,max,memoize,min,noop,once,partition,product,randomChance,randomNumber,range,round,scroll,shuffle,sleep,splitAt,splitStrAt,sum,tail,take,throttle,toArray,toCamel,toKebab,toNumber,toOrdinal,truncate,uniq,uuid});
|
package/dist/index.d.cts
CHANGED
|
@@ -4,6 +4,13 @@ type Fn<T = any> = (...args: any[]) => T;
|
|
|
4
4
|
type VoidFn = Fn<void>;
|
|
5
5
|
type Obj<V = unknown> = Record<string | symbol | number, V>;
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Clones an array.
|
|
9
|
+
*
|
|
10
|
+
* @param array - The array.
|
|
11
|
+
* @returns A clone of the array.
|
|
12
|
+
*/
|
|
13
|
+
declare function clone<T>(array: readonly T[]): T[];
|
|
7
14
|
/**
|
|
8
15
|
* Removes the first `n` items of an array.
|
|
9
16
|
*
|
|
@@ -46,11 +53,11 @@ declare function last<T>(array: readonly T[]): T;
|
|
|
46
53
|
/**
|
|
47
54
|
* Splits an array into two based on a predicate function.
|
|
48
55
|
*
|
|
49
|
-
* @param filter - The predicate function.
|
|
50
56
|
* @param array - The array.
|
|
57
|
+
* @param filter - The predicate function.
|
|
51
58
|
* @returns The tuple of values that satisfy the predicate and those that don't.
|
|
52
59
|
*/
|
|
53
|
-
declare function partition<T, U = T>(filter: (current: T | U, idx: number, array: readonly (T | U)[]) => boolean
|
|
60
|
+
declare function partition<T, U = T>(array: readonly (T | U)[], filter: (current: T | U, idx: number, array: readonly (T | U)[]) => boolean): [T[], U[]];
|
|
54
61
|
/**
|
|
55
62
|
* Generates a range of numbers.
|
|
56
63
|
*
|
|
@@ -61,6 +68,13 @@ declare function partition<T, U = T>(filter: (current: T | U, idx: number, array
|
|
|
61
68
|
*/
|
|
62
69
|
declare function range(stop: number): number[];
|
|
63
70
|
declare function range(start: number, stop: number, step?: number): number[];
|
|
71
|
+
/**
|
|
72
|
+
* Randomly shuffles items in an array.
|
|
73
|
+
*
|
|
74
|
+
* @param array - The array.
|
|
75
|
+
* @returns A copy of the array with its items randomly shuffled.
|
|
76
|
+
*/
|
|
77
|
+
declare function shuffle<T>(array: readonly T[]): T[];
|
|
64
78
|
/**
|
|
65
79
|
* Splits an array into two at a specified index.
|
|
66
80
|
*
|
|
@@ -238,6 +252,15 @@ declare function isWindow(val: unknown): val is Window;
|
|
|
238
252
|
* @returns The rounded number.
|
|
239
253
|
*/
|
|
240
254
|
declare function ceil(n: number, factor?: number): number;
|
|
255
|
+
/**
|
|
256
|
+
* Restricts a number between two bounds.
|
|
257
|
+
*
|
|
258
|
+
* @param n - The number to restrict.
|
|
259
|
+
* @param min - The minimum bound.
|
|
260
|
+
* @param max - The maximum bound.
|
|
261
|
+
* @returns The number restricted between the specified bounds.
|
|
262
|
+
*/
|
|
263
|
+
declare function clamp(n: number, min: number, max: number): number;
|
|
241
264
|
/**
|
|
242
265
|
* Rounds a number down to the nearest multiple of the specified factor.
|
|
243
266
|
*
|
|
@@ -276,6 +299,13 @@ declare function max(array: readonly number[]): number;
|
|
|
276
299
|
*/
|
|
277
300
|
declare function min(array: readonly []): undefined;
|
|
278
301
|
declare function min(array: readonly number[]): number;
|
|
302
|
+
/**
|
|
303
|
+
* Returns the product of a number array.
|
|
304
|
+
*
|
|
305
|
+
* @param ns - The number array.
|
|
306
|
+
* @returns The product.
|
|
307
|
+
*/
|
|
308
|
+
declare function product(ns: readonly number[]): number;
|
|
279
309
|
/**
|
|
280
310
|
* Rolls an n-sided die.
|
|
281
311
|
*
|
|
@@ -414,4 +444,4 @@ declare function toOrdinal(n: number): string;
|
|
|
414
444
|
*/
|
|
415
445
|
declare function truncate(str: string, length: number, suffix?: string): string;
|
|
416
446
|
|
|
417
|
-
export { type Arrayable, type Fn, type Nullable, type Obj, type VoidFn, capitalise, ceil, chars, debounce, deepMerge, drop, floor, groupsOf, head, init, isArray, isBlank, isBoolean, isBrowser, isDefined, isEmpty, isEmptyObject, isEven, isFunction, isNull, isNumber, isObject, isOdd, isString, isTouchDevice, isWindow, last, max, memoize, min, noop, once, partition, randomChance, randomNumber, range, round, scroll, sleep, splitAt, splitStrAt, sum, tail, take, throttle, toArray, toCamel, toKebab, toNumber, toOrdinal, truncate, uniq, uuid };
|
|
447
|
+
export { type Arrayable, type Fn, type Nullable, type Obj, type VoidFn, capitalise, ceil, chars, clamp, clone, debounce, deepMerge, drop, floor, groupsOf, head, init, isArray, isBlank, isBoolean, isBrowser, isDefined, isEmpty, isEmptyObject, isEven, isFunction, isNull, isNumber, isObject, isOdd, isString, isTouchDevice, isWindow, last, max, memoize, min, noop, once, partition, product, randomChance, randomNumber, range, round, scroll, shuffle, sleep, splitAt, splitStrAt, sum, tail, take, throttle, toArray, toCamel, toKebab, toNumber, toOrdinal, truncate, uniq, uuid };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,13 @@ type Fn<T = any> = (...args: any[]) => T;
|
|
|
4
4
|
type VoidFn = Fn<void>;
|
|
5
5
|
type Obj<V = unknown> = Record<string | symbol | number, V>;
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Clones an array.
|
|
9
|
+
*
|
|
10
|
+
* @param array - The array.
|
|
11
|
+
* @returns A clone of the array.
|
|
12
|
+
*/
|
|
13
|
+
declare function clone<T>(array: readonly T[]): T[];
|
|
7
14
|
/**
|
|
8
15
|
* Removes the first `n` items of an array.
|
|
9
16
|
*
|
|
@@ -46,11 +53,11 @@ declare function last<T>(array: readonly T[]): T;
|
|
|
46
53
|
/**
|
|
47
54
|
* Splits an array into two based on a predicate function.
|
|
48
55
|
*
|
|
49
|
-
* @param filter - The predicate function.
|
|
50
56
|
* @param array - The array.
|
|
57
|
+
* @param filter - The predicate function.
|
|
51
58
|
* @returns The tuple of values that satisfy the predicate and those that don't.
|
|
52
59
|
*/
|
|
53
|
-
declare function partition<T, U = T>(filter: (current: T | U, idx: number, array: readonly (T | U)[]) => boolean
|
|
60
|
+
declare function partition<T, U = T>(array: readonly (T | U)[], filter: (current: T | U, idx: number, array: readonly (T | U)[]) => boolean): [T[], U[]];
|
|
54
61
|
/**
|
|
55
62
|
* Generates a range of numbers.
|
|
56
63
|
*
|
|
@@ -61,6 +68,13 @@ declare function partition<T, U = T>(filter: (current: T | U, idx: number, array
|
|
|
61
68
|
*/
|
|
62
69
|
declare function range(stop: number): number[];
|
|
63
70
|
declare function range(start: number, stop: number, step?: number): number[];
|
|
71
|
+
/**
|
|
72
|
+
* Randomly shuffles items in an array.
|
|
73
|
+
*
|
|
74
|
+
* @param array - The array.
|
|
75
|
+
* @returns A copy of the array with its items randomly shuffled.
|
|
76
|
+
*/
|
|
77
|
+
declare function shuffle<T>(array: readonly T[]): T[];
|
|
64
78
|
/**
|
|
65
79
|
* Splits an array into two at a specified index.
|
|
66
80
|
*
|
|
@@ -238,6 +252,15 @@ declare function isWindow(val: unknown): val is Window;
|
|
|
238
252
|
* @returns The rounded number.
|
|
239
253
|
*/
|
|
240
254
|
declare function ceil(n: number, factor?: number): number;
|
|
255
|
+
/**
|
|
256
|
+
* Restricts a number between two bounds.
|
|
257
|
+
*
|
|
258
|
+
* @param n - The number to restrict.
|
|
259
|
+
* @param min - The minimum bound.
|
|
260
|
+
* @param max - The maximum bound.
|
|
261
|
+
* @returns The number restricted between the specified bounds.
|
|
262
|
+
*/
|
|
263
|
+
declare function clamp(n: number, min: number, max: number): number;
|
|
241
264
|
/**
|
|
242
265
|
* Rounds a number down to the nearest multiple of the specified factor.
|
|
243
266
|
*
|
|
@@ -276,6 +299,13 @@ declare function max(array: readonly number[]): number;
|
|
|
276
299
|
*/
|
|
277
300
|
declare function min(array: readonly []): undefined;
|
|
278
301
|
declare function min(array: readonly number[]): number;
|
|
302
|
+
/**
|
|
303
|
+
* Returns the product of a number array.
|
|
304
|
+
*
|
|
305
|
+
* @param ns - The number array.
|
|
306
|
+
* @returns The product.
|
|
307
|
+
*/
|
|
308
|
+
declare function product(ns: readonly number[]): number;
|
|
279
309
|
/**
|
|
280
310
|
* Rolls an n-sided die.
|
|
281
311
|
*
|
|
@@ -414,4 +444,4 @@ declare function toOrdinal(n: number): string;
|
|
|
414
444
|
*/
|
|
415
445
|
declare function truncate(str: string, length: number, suffix?: string): string;
|
|
416
446
|
|
|
417
|
-
export { type Arrayable, type Fn, type Nullable, type Obj, type VoidFn, capitalise, ceil, chars, debounce, deepMerge, drop, floor, groupsOf, head, init, isArray, isBlank, isBoolean, isBrowser, isDefined, isEmpty, isEmptyObject, isEven, isFunction, isNull, isNumber, isObject, isOdd, isString, isTouchDevice, isWindow, last, max, memoize, min, noop, once, partition, randomChance, randomNumber, range, round, scroll, sleep, splitAt, splitStrAt, sum, tail, take, throttle, toArray, toCamel, toKebab, toNumber, toOrdinal, truncate, uniq, uuid };
|
|
447
|
+
export { type Arrayable, type Fn, type Nullable, type Obj, type VoidFn, capitalise, ceil, chars, clamp, clone, debounce, deepMerge, drop, floor, groupsOf, head, init, isArray, isBlank, isBoolean, isBrowser, isDefined, isEmpty, isEmptyObject, isEven, isFunction, isNull, isNumber, isObject, isOdd, isString, isTouchDevice, isWindow, last, max, memoize, min, noop, once, partition, product, randomChance, randomNumber, range, round, scroll, shuffle, sleep, splitAt, splitStrAt, sum, tail, take, throttle, toArray, toCamel, toKebab, toNumber, toOrdinal, truncate, uniq, uuid };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function N(n,e=1){let t=n/e;return Math.ceil(t)*e}function U(n,e,t){return Math.min(t,Math.max(e,n))}function A(n,e=1){let t=n/e;return Math.floor(t)*e}function M(n){return n%2===0}function F(n){return n%2!==0}function S(n){if(n.length)return Math.max(...n)}function E(n){if(n.length)return Math.min(...n)}function C(n){let e=1;for(let t=0;t<n.length;t++)e*=n[t];return e}function q(n){return s(n)===0}function s(...n){let e,t;return n.length===1?(e=0,t=n[0]):(e=n[0],t=n[1]),Math.floor(Math.random()*(t-e))+e}function I(n,e=1){let t=n/e;return Math.round(t)*e}function V(n){let e=0;for(let t=0;t<n.length;t++)e+=n[t];return e}function h(n){if(n.length===0)return[];let e=[];for(let t=0;t<n.length;t++)e[t]=n[t];return e}function D(n,e){return n<=0?[...e]:e.slice(n)}function L(n,e){if(n<=0)throw new Error("[tsu] Invalid group size. Is it greater than 0?");if(n>=e.length)return[[...e]];let t=[];for(let r=0;r<e.length;r+=n)t.push(e.slice(r,r+n));return t}function P(n){return n[0]}function W(n){return n.slice(0,n.length-1)}function H(n){return n[n.length-1]}function _(n,e){let t=[],r=[];for(let o=0;o<n.length;o++){let u=n[o];e(u,o,n)?t.push(u):r.push(u)}return[t,r]}function $(...n){let e,t,r;n.length===1?(t=n[0],e=0,r=1):(e=n[0],t=n[1],r=n[2]||1),r<=0&&(console.warn("[tsu] warning: a step less than or equal to 0 will be set to 1."),r=1);let o=[],u=e;for(;u<t;)o.push(u),u+=r||1;return o}function z(n){let e=h(n),t,r,o;for(t=e.length;t;t-=1)r=s(t),o=e[t-1],e[t-1]=e[r],e[r]=o;return e}function J(n,e){return n<=0?[[],[...e]]:n>e.length?[[...e],[]]:[e.slice(0,n),e.slice(n)]}function K(n){return n.slice(1)}function Y(n,e){return n<=0?[]:e.slice(0,n)}function Z(n){return n?Array.isArray(n)?n:[n]:[]}function x(n){return Array.from(new Set(n))}function c(n){return Array.isArray(n)}function Q(n){return typeof n=="boolean"}function w(){return typeof window<"u"}function X(n){return typeof n<"u"}function nn(n){if(!l(n))return!1;for(let e in n)return!1;return!0}function en(n){return typeof n=="function"}function tn(n){return Object.prototype.toString.call(n)==="[object Null]"}function T(n){return typeof n=="number"}function l(n){return Object.prototype.toString.call(n)==="[object Object]"}function f(n){return typeof n=="string"}function rn(){return"ontouchstart"in window||navigator.maxTouchPoints>0}function on(n){return w()&&Object.prototype.toString.call(n)==="[object Window]"}function sn({to:n,offset:e=0,duration:t=1e3,container:r=null}){let o=f(n)?document.querySelector(n):n,u=f(r)?document.querySelector(r):r,i=u?.scrollTop||window?.pageYOffset||0,a=(T(o)?o:O(o,i))+e,y=Date.now();function m(){let p=Date.now()-y,b=p<t,d=b?j(i,a,p,t):a;b&&requestAnimationFrame(m),u?u.scrollTop=d:window.scrollTo(0,d)}m()}function v(n){return n<.5?4*Math.pow(n,3):(n-1)*(2*n-2)*(2*n-2)+1}function j(n,e,t,r){return n+(e-n)*v(t/r)}function O(n,e){return n.nodeName==="HTML"?-e:n.getBoundingClientRect().top+e}function fn(n,e){e<0&&console.warn("[tsu] warning: a debounce delay less than 0ms will be treated as 0ms.");let t;return function(...r){clearTimeout(t),t=setTimeout(()=>{clearTimeout(t),n(...r)},e)}}function an(n){let e={};return function(...t){let r=JSON.stringify(t);if(r in e)return e[r];let o=n(...t);return e[r]=o,o}}function mn(n){let e=!1;return(...t)=>{e||(n(...t),e=!0)}}function pn(n,e){e<0&&console.warn("[tsu] warning: a throttle limit less than 0ms will be treated as 0ms.");let t=!1;return function(...r){t||(n(...r),t=!0,setTimeout(()=>{t=!1},e))}}function dn(){}async function xn(n){return n<0&&console.warn("[tsu] warning: a sleep duration less than 0ms will be treated as 0ms."),new Promise(e=>{setTimeout(e,n)})}var g="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";function Tn(n=16){let e=g.length,t=n,r="";for(;t--;)r+=g[Math.random()*e|0];return r}function k(...n){let e={};for(let t=0;t<n.length;t++){let r=n[t],o=Object.keys(r);for(let u=0;u<o.length;u++){let i=o[u];c(e[i])&&c(r[i])?e[i]=x(e[i].concat(r[i])):l(e[i])&&l(r[i])?e[i]=k(e[i],r[i]):e[i]=r[i]}}return e}function vn(n,e=!1,t=" "){return e?n.split(t).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(t):n.charAt(0).toUpperCase()+n.slice(1)}function jn(n){return n.split("")}function On(n){return n.trim().length===0}function kn(n){return n.length===0}function Nn(n,e){return n<=0?["",e]:n>e.length?[e,""]:[e.slice(0,n),e.slice(n)]}function Un(n){let e=/-(\w)/g;return n.replace(e,(t,r)=>r?r.toUpperCase():"")}function An(n){let e=/\B([A-Z])/g;return n.replace(e,"-$1").toLowerCase()}function Mn(n){return n.length?Number(n.replace(/[#£€$,%]/g,"")):NaN}function Fn(n){let t=["st","nd","rd"][(n/10%10^1&&n%10)-1]||"th";return`${n}${t}`}function Sn(n,e,t="..."){return e<=0?t:n.slice(0,e)+t}export{vn as capitalise,N as ceil,jn as chars,U as clamp,h as clone,fn as debounce,k as deepMerge,D as drop,A as floor,L as groupsOf,P as head,W as init,c as isArray,On as isBlank,Q as isBoolean,w as isBrowser,X as isDefined,kn as isEmpty,nn as isEmptyObject,M as isEven,en as isFunction,tn as isNull,T as isNumber,l as isObject,F as isOdd,f as isString,rn as isTouchDevice,on as isWindow,H as last,S as max,an as memoize,E as min,dn as noop,mn as once,_ as partition,C as product,q as randomChance,s as randomNumber,$ as range,I as round,sn as scroll,z as shuffle,xn as sleep,J as splitAt,Nn as splitStrAt,V as sum,K as tail,Y as take,pn as throttle,Z as toArray,Un as toCamel,An as toKebab,Mn as toNumber,Fn as toOrdinal,Sn as truncate,x as uniq,Tn as uuid};
|