@aliexme/js-utils 2.4.0 → 2.4.1
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/array/index.d.ts +2 -2
- package/dist/function/index.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +50 -50
- package/dist/number/floor.cjs +1 -1
- package/dist/number/floor.js +2 -2
- package/dist/number/index.d.ts +3 -3
- package/dist/number/round.cjs +1 -1
- package/dist/number/round.js +2 -2
- package/dist/object/index.d.ts +1 -1
- package/dist/string/index.d.ts +1 -1
- package/dist/string/randomString.cjs +1 -1
- package/dist/string/randomString.js +3 -3
- package/package.json +2 -2
package/dist/array/index.d.ts
CHANGED
package/dist/function/index.d.ts
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./array/arraysIntersection.cjs"),r=require("./async/asyncResult.cjs"),t=require("./async/asyncify.cjs"),o=require("./string/capitalize.cjs"),n=require("./number/clamp.cjs"),c=require("./function/debounce.cjs"),i=require("./object/findObjectKey.cjs"),s=require("./number/floor.cjs"),u=require("./object/getObjectKey.cjs"),a=require("./array/groupArrayItems.cjs"),y=require("./number/lerp.cjs"),m=require("./function/noop.cjs"),d=require("./object/objectForEach.cjs"),q=require("./object/omitObjectProperties.cjs"),l=require("./object/omitUndefinedObjectValues.cjs"),b=require("./array/randomArrayItem.cjs"),p=require("./number/randomInt.cjs"),f=require("./number/randomNumber.cjs"),j=require("./string/randomString.cjs"),g=require("./number/round.cjs"),O=require("./string/secureString.cjs"),I=require("./async/sleep.cjs"),A=require("./array/subtractArrays.cjs"),S=require("./function/throttle.cjs"),h=require("./array/uniquify.cjs");exports.arraysIntersection=e.arraysIntersection;exports.asyncResult=r.asyncResult;exports.asyncify=t.asyncify;exports.capitalize=o.capitalize;exports.clamp=n.clamp;exports.debounce=c.debounce;exports.findObjectKey=i.findObjectKey;exports.floor=s.floor;exports.getObjectKey=u.getObjectKey;exports.groupArrayItems=a.groupArrayItems;exports.lerp=y.lerp;exports.noop=m.noop;exports.objectForEach=d.objectForEach;exports.omitObjectProperties=q.omitObjectProperties;exports.omitUndefinedObjectValues=l.omitUndefinedObjectValues;exports.randomArrayItem=b.randomArrayItem;exports.randomInt=p.randomInt;exports.randomNumber=f.randomNumber;exports.randomString=j.randomString;exports.round=g.round;exports.secureString=O.secureString;exports.sleep=I.sleep;exports.subtractArrays=A.subtractArrays;exports.throttle=S.throttle;exports.uniquify=h.uniquify;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './string';
|
|
2
|
-
export * from './number';
|
|
3
1
|
export * from './array';
|
|
4
|
-
export * from './object';
|
|
5
|
-
export * from './function';
|
|
6
2
|
export * from './async';
|
|
3
|
+
export * from './function';
|
|
4
|
+
export * from './number';
|
|
5
|
+
export * from './object';
|
|
6
|
+
export * from './string';
|
package/dist/index.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
1
|
+
import { arraysIntersection as e } from "./array/arraysIntersection.js";
|
|
2
|
+
import { asyncResult as m } from "./async/asyncResult.js";
|
|
3
|
+
import { asyncify as f } from "./async/asyncify.js";
|
|
4
|
+
import { capitalize as n } from "./string/capitalize.js";
|
|
5
|
+
import { clamp as c } from "./number/clamp.js";
|
|
6
|
+
import { debounce as s } from "./function/debounce.js";
|
|
7
|
+
import { findObjectKey as y } from "./object/findObjectKey.js";
|
|
8
|
+
import { floor as b } from "./number/floor.js";
|
|
9
|
+
import { getObjectKey as j } from "./object/getObjectKey.js";
|
|
10
|
+
import { groupArrayItems as I } from "./array/groupArrayItems.js";
|
|
11
|
+
import { lerp as A } from "./number/lerp.js";
|
|
12
|
+
import { noop as K } from "./function/noop.js";
|
|
13
|
+
import { objectForEach as q } from "./object/objectForEach.js";
|
|
14
|
+
import { omitObjectProperties as E } from "./object/omitObjectProperties.js";
|
|
15
|
+
import { omitUndefinedObjectValues as N } from "./object/omitUndefinedObjectValues.js";
|
|
16
|
+
import { randomArrayItem as R } from "./array/randomArrayItem.js";
|
|
17
|
+
import { randomInt as V } from "./number/randomInt.js";
|
|
18
|
+
import { randomNumber as v } from "./number/randomNumber.js";
|
|
19
|
+
import { randomString as B } from "./string/randomString.js";
|
|
20
|
+
import { round as D } from "./number/round.js";
|
|
21
|
+
import { secureString as H } from "./string/secureString.js";
|
|
22
|
+
import { sleep as L } from "./async/sleep.js";
|
|
23
|
+
import { subtractArrays as Q } from "./array/subtractArrays.js";
|
|
24
|
+
import { throttle as W } from "./function/throttle.js";
|
|
25
|
+
import { uniquify as Y } from "./array/uniquify.js";
|
|
26
26
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
27
|
+
e as arraysIntersection,
|
|
28
|
+
m as asyncResult,
|
|
29
|
+
f as asyncify,
|
|
30
|
+
n as capitalize,
|
|
31
|
+
c as clamp,
|
|
32
|
+
s as debounce,
|
|
33
|
+
y as findObjectKey,
|
|
34
|
+
b as floor,
|
|
35
|
+
j as getObjectKey,
|
|
36
|
+
I as groupArrayItems,
|
|
37
|
+
A as lerp,
|
|
38
|
+
K as noop,
|
|
39
|
+
q as objectForEach,
|
|
40
|
+
E as omitObjectProperties,
|
|
41
|
+
N as omitUndefinedObjectValues,
|
|
42
|
+
R as randomArrayItem,
|
|
43
|
+
V as randomInt,
|
|
44
|
+
v as randomNumber,
|
|
45
|
+
B as randomString,
|
|
46
|
+
D as round,
|
|
47
|
+
H as secureString,
|
|
48
|
+
L as sleep,
|
|
49
|
+
Q as subtractArrays,
|
|
50
|
+
W as throttle,
|
|
51
|
+
Y as uniquify
|
|
52
52
|
};
|
package/dist/number/floor.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=(t,o=0)=>Math.floor(t*
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=(t,o=0)=>Math.floor(t*10**o)/10**o;exports.floor=r;
|
package/dist/number/floor.js
CHANGED
package/dist/number/index.d.ts
CHANGED
package/dist/number/round.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=(r,t=0)=>Math.round(r*10**t)/10**t;exports.round=e;
|
package/dist/number/round.js
CHANGED
package/dist/object/index.d.ts
CHANGED
package/dist/string/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../array/randomArrayItem.cjs"),u=require("../number/randomInt.cjs"),d=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],i=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],m=["0","1","2","3","4","5","6","7","8","9"],l=["!","#","@","~","$","^",".",",","-","+","%","?","*","="],p={1:d,2:i,3:m,4:l},g=(o={})=>{const{length:n=16}=o;let r="";for(let t=0;t<n;t++){const e=u.randomInt(1,4),s=p[e],c=a.randomArrayItem(s);r+=c}return r};exports.randomString=g;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { randomArrayItem as a } from "../array/randomArrayItem.js";
|
|
2
|
+
import { randomInt as m } from "../number/randomInt.js";
|
|
3
3
|
const p = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"], i = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"], l = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], u = ["!", "#", "@", "~", "$", "^", ".", ",", "-", "+", "%", "?", "*", "="], d = {
|
|
4
4
|
1: p,
|
|
5
5
|
2: i,
|
|
@@ -9,7 +9,7 @@ const p = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n",
|
|
|
9
9
|
const { length: n = 16 } = t;
|
|
10
10
|
let o = "";
|
|
11
11
|
for (let r = 0; r < n; r++) {
|
|
12
|
-
const s =
|
|
12
|
+
const s = m(1, 4), c = d[s], e = a(c);
|
|
13
13
|
o += e;
|
|
14
14
|
}
|
|
15
15
|
return o;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aliexme/js-utils",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Common JavaScript utilities",
|
|
6
6
|
"homepage": "https://github.com/aliexme/web-shared/tree/main/packages/js-utils",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "1d314fb2f9ed2802b1ca152cedff0b0ee853e6dd"
|
|
36
36
|
}
|