@stryke/helpers 0.5.0 â 0.5.2
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/README.md +15 -17
- package/dist/index.cjs +0 -11
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -18
- package/dist/deep-copy.cjs +0 -86
- package/dist/deep-copy.d.ts +0 -11
- package/dist/deep-copy.mjs +0 -1
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ This package is part of Storm Software's **đŠī¸ Stryke** monorepo. Stryke pac
|
|
|
22
22
|
|
|
23
23
|
<h3 align="center">đģ Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
24
24
|
|
|
25
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
26
26
|
|
|
27
27
|
> [!IMPORTANT] This repository, and the apps, libraries, and tools contained
|
|
28
28
|
> within, is still in it's initial development phase. As a result, bugs and
|
|
@@ -54,22 +54,20 @@ other Stryke projects.
|
|
|
54
54
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
55
55
|
## Table of Contents
|
|
56
56
|
|
|
57
|
-
- [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
- [
|
|
62
|
-
- [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- [Contributing](#contributing)
|
|
72
|
-
- [Contributors](#contributors)
|
|
57
|
+
- [Quick Features](#quick-features)
|
|
58
|
+
- [Installing](#installing)
|
|
59
|
+
- [Reduced Package Size](#reduced-package-size)
|
|
60
|
+
- [Development](#development)
|
|
61
|
+
- [Building](#building)
|
|
62
|
+
- [Running unit tests](#running-unit-tests)
|
|
63
|
+
- [Linting](#linting)
|
|
64
|
+
- [Storm Workspaces](#storm-workspaces)
|
|
65
|
+
- [Roadmap](#roadmap)
|
|
66
|
+
- [Support](#support)
|
|
67
|
+
- [License](#license)
|
|
68
|
+
- [Changelog](#changelog)
|
|
69
|
+
- [Contributing](#contributing)
|
|
70
|
+
- [Contributors](#contributors)
|
|
73
71
|
|
|
74
72
|
<!-- END doctoc -->
|
|
75
73
|
|
package/dist/index.cjs
CHANGED
|
@@ -36,17 +36,6 @@ Object.keys(_deepClone).forEach(function (key) {
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
|
-
var _deepCopy = require("./deep-copy.cjs");
|
|
40
|
-
Object.keys(_deepCopy).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _deepCopy[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _deepCopy[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
39
|
var _deepMerge = require("./deep-merge.cjs");
|
|
51
40
|
Object.keys(_deepMerge).forEach(function (key) {
|
|
52
41
|
if (key === "default" || key === "__esModule") return;
|
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./arg-identity";export*from"./debounce";export*from"./deep-clone";export*from"./deep-
|
|
1
|
+
export*from"./arg-identity";export*from"./debounce";export*from"./deep-clone";export*from"./deep-merge";export*from"./delay";export*from"./filter-empty";export*from"./flatten-object";export*from"./get-field";export*from"./get-ordered-by";export*from"./get-unique";export*from"./identity";export*from"./is-equal";export*from"./match-sorter";export*from"./mutex";export*from"./noop";export*from"./remove-accents";export*from"./remove-empty-items";export*from"./semaphore";export*from"./set-field";export*from"./throttle";export*from"./timeout";export*from"./to-deep-key";export*from"./to-path";export*from"./unflatten-object";export*from"./union";export*from"./with-timeout";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/helpers",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing miscellaneous helper functions that are used across many different Storm Software projects.",
|
|
6
6
|
"repository": {
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"private": false,
|
|
12
12
|
"publishConfig": { "access": "public" },
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@stryke/convert": "^0.1.
|
|
15
|
-
"@stryke/type-checks": "^0.3.
|
|
16
|
-
"@stryke/types": "^0.8.
|
|
14
|
+
"@stryke/convert": "^0.1.5",
|
|
15
|
+
"@stryke/type-checks": "^0.3.1",
|
|
16
|
+
"@stryke/types": "^0.8.1"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {},
|
|
19
19
|
"sideEffects": false,
|
|
@@ -376,20 +376,6 @@
|
|
|
376
376
|
"default": "./dist/deep-merge.mjs"
|
|
377
377
|
}
|
|
378
378
|
},
|
|
379
|
-
"./deep-copy": {
|
|
380
|
-
"import": {
|
|
381
|
-
"types": "./dist/deep-copy.d.ts",
|
|
382
|
-
"default": "./dist/deep-copy.mjs"
|
|
383
|
-
},
|
|
384
|
-
"require": {
|
|
385
|
-
"types": "./dist/deep-copy.d.ts",
|
|
386
|
-
"default": "./dist/deep-copy.cjs"
|
|
387
|
-
},
|
|
388
|
-
"default": {
|
|
389
|
-
"types": "./dist/deep-copy.d.ts",
|
|
390
|
-
"default": "./dist/deep-copy.mjs"
|
|
391
|
-
}
|
|
392
|
-
},
|
|
393
379
|
"./deep-clone": {
|
|
394
380
|
"import": {
|
|
395
381
|
"types": "./dist/deep-clone.d.ts",
|
package/dist/deep-copy.cjs
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.deepCopy = deepCopy;
|
|
7
|
-
function A(r) {
|
|
8
|
-
const t = new ArrayBuffer(r.byteLength);
|
|
9
|
-
return new Uint8Array(t).set(new Uint8Array(r)), t;
|
|
10
|
-
}
|
|
11
|
-
function C(r) {
|
|
12
|
-
const t = A(r.buffer);
|
|
13
|
-
return new DataView(t, r.byteOffset, r.byteLength);
|
|
14
|
-
}
|
|
15
|
-
function g(r) {
|
|
16
|
-
return new Date(r.getTime());
|
|
17
|
-
}
|
|
18
|
-
function d(r) {
|
|
19
|
-
const t = new Map();
|
|
20
|
-
for (const [n, o] of r.entries()) t.set(deepCopy(n), deepCopy(o));
|
|
21
|
-
return t;
|
|
22
|
-
}
|
|
23
|
-
const u = {
|
|
24
|
-
"[object Float32Array]": Float32Array,
|
|
25
|
-
"[object Float64Array]": Float64Array,
|
|
26
|
-
"[object Int8Array]": Int8Array,
|
|
27
|
-
"[object Int16Array]": Int16Array,
|
|
28
|
-
"[object Int32Array]": Int32Array,
|
|
29
|
-
"[object Uint8Array]": Uint8Array,
|
|
30
|
-
"[object Uint16Array]": Uint16Array,
|
|
31
|
-
"[object Uint32Array]": Uint32Array,
|
|
32
|
-
"[object Uint8ClampedArray]": Uint8ClampedArray
|
|
33
|
-
},
|
|
34
|
-
j = {
|
|
35
|
-
"[object Date]": g,
|
|
36
|
-
"[object ArrayBuffer]": A,
|
|
37
|
-
"[object DataView]": C,
|
|
38
|
-
"[object Float32Array]": e,
|
|
39
|
-
"[object Float64Array]": e,
|
|
40
|
-
"[object Int8Array]": e,
|
|
41
|
-
"[object Int16Array]": e,
|
|
42
|
-
"[object Int32Array]": e,
|
|
43
|
-
"[object Uint8Array]": e,
|
|
44
|
-
"[object Uint8ClampedArray]": e,
|
|
45
|
-
"[object Uint16Array]": e,
|
|
46
|
-
"[object Uint32Array]": e,
|
|
47
|
-
"[object BigInt64Array]": e,
|
|
48
|
-
"[object BigUint64Array]": e,
|
|
49
|
-
"[object RegExp]": cloneRegExp,
|
|
50
|
-
"[object Map]": d
|
|
51
|
-
};
|
|
52
|
-
function e(r) {
|
|
53
|
-
try {
|
|
54
|
-
u["[object BigInt64Array]"] = BigInt64Array, u["[object BigUint64Array]"] = BigUint64Array;
|
|
55
|
-
} catch {}
|
|
56
|
-
const t = A(r.buffer),
|
|
57
|
-
n = u[Object.prototype.toString.call(r)];
|
|
58
|
-
if (!n) throw new Error("Unsupported typed array type in `cloneTypedArray`.");
|
|
59
|
-
return new n(t).subarray(r.byteOffset, r.byteOffset + r.length);
|
|
60
|
-
}
|
|
61
|
-
function f(r, t, n, o, y) {
|
|
62
|
-
const a = detectType(r),
|
|
63
|
-
i = copy(r, a);
|
|
64
|
-
if (!isCollection(a)) return i;
|
|
65
|
-
const b = getKeys(r, a);
|
|
66
|
-
for (const s of b) {
|
|
67
|
-
const c = getValue(r, s, a);
|
|
68
|
-
if (o.has(c)) setValue(t, s, n.get(c), a);else {
|
|
69
|
-
const p = detectType(c),
|
|
70
|
-
l = copy(c, p);
|
|
71
|
-
isCollection(p) && (n.set(c, l), o.add(c)), setValue(t, s, f(c, l, n, o, y), a);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return t;
|
|
75
|
-
}
|
|
76
|
-
function deepCopy(r, t) {
|
|
77
|
-
const {
|
|
78
|
-
customizer: n = null
|
|
79
|
-
} = t ?? {},
|
|
80
|
-
o = detectType(r);
|
|
81
|
-
if (!isCollection(o)) return copy(r, o, n);
|
|
82
|
-
const y = copy(r, o, n),
|
|
83
|
-
a = new WeakMap([[r, y]]),
|
|
84
|
-
i = new WeakSet([r]);
|
|
85
|
-
return f(r, y, a, i, n);
|
|
86
|
-
}
|
package/dist/deep-copy.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface Options {
|
|
2
|
-
customizer?: Customizer;
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Deep copy value
|
|
6
|
-
*
|
|
7
|
-
* @param value - The value to copy.
|
|
8
|
-
* @param options - The options object.
|
|
9
|
-
* @returns Returns the copied value.
|
|
10
|
-
*/
|
|
11
|
-
export declare function deepCopy<T extends Record<string, any>>(value: T, options?: Options): T;
|
package/dist/deep-copy.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function A(r){const t=new ArrayBuffer(r.byteLength);return new Uint8Array(t).set(new Uint8Array(r)),t}function C(r){const t=A(r.buffer);return new DataView(t,r.byteOffset,r.byteLength)}function g(r){return new Date(r.getTime())}function d(r){const t=new Map;for(const[n,o]of r.entries())t.set(deepCopy(n),deepCopy(o));return t}const u={"[object Float32Array]":Float32Array,"[object Float64Array]":Float64Array,"[object Int8Array]":Int8Array,"[object Int16Array]":Int16Array,"[object Int32Array]":Int32Array,"[object Uint8Array]":Uint8Array,"[object Uint16Array]":Uint16Array,"[object Uint32Array]":Uint32Array,"[object Uint8ClampedArray]":Uint8ClampedArray},j={"[object Date]":g,"[object ArrayBuffer]":A,"[object DataView]":C,"[object Float32Array]":e,"[object Float64Array]":e,"[object Int8Array]":e,"[object Int16Array]":e,"[object Int32Array]":e,"[object Uint8Array]":e,"[object Uint8ClampedArray]":e,"[object Uint16Array]":e,"[object Uint32Array]":e,"[object BigInt64Array]":e,"[object BigUint64Array]":e,"[object RegExp]":cloneRegExp,"[object Map]":d};function e(r){try{u["[object BigInt64Array]"]=BigInt64Array,u["[object BigUint64Array]"]=BigUint64Array}catch{}const t=A(r.buffer),n=u[Object.prototype.toString.call(r)];if(!n)throw new Error("Unsupported typed array type in `cloneTypedArray`.");return new n(t).subarray(r.byteOffset,r.byteOffset+r.length)}function f(r,t,n,o,y){const a=detectType(r),i=copy(r,a);if(!isCollection(a))return i;const b=getKeys(r,a);for(const s of b){const c=getValue(r,s,a);if(o.has(c))setValue(t,s,n.get(c),a);else{const p=detectType(c),l=copy(c,p);isCollection(p)&&(n.set(c,l),o.add(c)),setValue(t,s,f(c,l,n,o,y),a)}}return t}export function deepCopy(r,t){const{customizer:n=null}=t??{},o=detectType(r);if(!isCollection(o))return copy(r,o,n);const y=copy(r,o,n),a=new WeakMap([[r,y]]),i=new WeakSet([r]);return f(r,y,a,i,n)}
|