@zag-js/utils 0.1.4 → 0.1.6
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.d.ts +1 -2
- package/dist/index.js +0 -18
- package/dist/index.mjs +0 -17
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,6 @@ declare const cast: <T>(v: unknown) => T;
|
|
|
23
23
|
declare const noop: () => void;
|
|
24
24
|
declare const callAll: <T extends (...a: any[]) => void>(...fns: (T | undefined)[]) => (...a: Parameters<T>) => void;
|
|
25
25
|
declare const uuid: () => string;
|
|
26
|
-
declare function merge<T, U>(origin: T, patch: U): T & U;
|
|
27
26
|
|
|
28
27
|
declare const isDev: () => boolean;
|
|
29
28
|
declare const isArray: (v: any) => v is any[];
|
|
@@ -39,4 +38,4 @@ declare function warn(c: boolean, m: string): void;
|
|
|
39
38
|
declare function invariant(m: string): void;
|
|
40
39
|
declare function invariant(c: boolean, m: string): void;
|
|
41
40
|
|
|
42
|
-
export { IndexOptions, add, callAll, cast, chunk, clear, first, fromLength, has, hasProp, invariant, isArray, isBoolean, isDev, isEmpty, isFunction, isNumber, isObject, isString, last,
|
|
41
|
+
export { IndexOptions, add, callAll, cast, chunk, clear, first, fromLength, has, hasProp, invariant, isArray, isBoolean, isDev, isEmpty, isFunction, isNumber, isObject, isString, last, next, nextIndex, noop, prev, prevIndex, remove, removeAt, runIfFn, toArray, uuid, warn };
|
package/dist/index.js
CHANGED
|
@@ -39,7 +39,6 @@ __export(src_exports, {
|
|
|
39
39
|
isObject: () => isObject,
|
|
40
40
|
isString: () => isString,
|
|
41
41
|
last: () => last,
|
|
42
|
-
merge: () => merge,
|
|
43
42
|
next: () => next,
|
|
44
43
|
nextIndex: () => nextIndex,
|
|
45
44
|
noop: () => noop,
|
|
@@ -132,22 +131,6 @@ var uuid = /* @__PURE__ */ (() => {
|
|
|
132
131
|
return id.toString(36);
|
|
133
132
|
};
|
|
134
133
|
})();
|
|
135
|
-
function merge(origin, patch) {
|
|
136
|
-
if (!(typeof patch === "object"))
|
|
137
|
-
return patch;
|
|
138
|
-
const result = !(typeof origin === "object") ? {} : Object.assign({}, origin);
|
|
139
|
-
for (const key of Object.keys(patch)) {
|
|
140
|
-
const value = patch[key];
|
|
141
|
-
const src = result[key];
|
|
142
|
-
if (value === null)
|
|
143
|
-
delete result[key];
|
|
144
|
-
else if (Array.isArray(value) || Array.isArray(src))
|
|
145
|
-
result[key] = (src || []).concat(value || []);
|
|
146
|
-
else
|
|
147
|
-
result[key] = merge(src, value);
|
|
148
|
-
}
|
|
149
|
-
return result;
|
|
150
|
-
}
|
|
151
134
|
|
|
152
135
|
// src/guard.ts
|
|
153
136
|
var isDev = () => process.env.NODE_ENV !== "production";
|
|
@@ -195,7 +178,6 @@ function invariant(...a) {
|
|
|
195
178
|
isObject,
|
|
196
179
|
isString,
|
|
197
180
|
last,
|
|
198
|
-
merge,
|
|
199
181
|
next,
|
|
200
182
|
nextIndex,
|
|
201
183
|
noop,
|
package/dist/index.mjs
CHANGED
|
@@ -76,22 +76,6 @@ var uuid = /* @__PURE__ */ (() => {
|
|
|
76
76
|
return id.toString(36);
|
|
77
77
|
};
|
|
78
78
|
})();
|
|
79
|
-
function merge(origin, patch) {
|
|
80
|
-
if (!(typeof patch === "object"))
|
|
81
|
-
return patch;
|
|
82
|
-
const result = !(typeof origin === "object") ? {} : Object.assign({}, origin);
|
|
83
|
-
for (const key of Object.keys(patch)) {
|
|
84
|
-
const value = patch[key];
|
|
85
|
-
const src = result[key];
|
|
86
|
-
if (value === null)
|
|
87
|
-
delete result[key];
|
|
88
|
-
else if (Array.isArray(value) || Array.isArray(src))
|
|
89
|
-
result[key] = (src || []).concat(value || []);
|
|
90
|
-
else
|
|
91
|
-
result[key] = merge(src, value);
|
|
92
|
-
}
|
|
93
|
-
return result;
|
|
94
|
-
}
|
|
95
79
|
|
|
96
80
|
// src/guard.ts
|
|
97
81
|
var isDev = () => process.env.NODE_ENV !== "production";
|
|
@@ -138,7 +122,6 @@ export {
|
|
|
138
122
|
isObject,
|
|
139
123
|
isString,
|
|
140
124
|
last,
|
|
141
|
-
merge,
|
|
142
125
|
next,
|
|
143
126
|
nextIndex,
|
|
144
127
|
noop,
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/utils",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
5
8
|
"keywords": [
|
|
6
9
|
"js",
|
|
7
10
|
"utils",
|
|
@@ -10,9 +13,6 @@
|
|
|
10
13
|
"author": "Segun Adebayo <sage@adebayosegun.com>",
|
|
11
14
|
"homepage": "https://github.com/chakra-ui/zag#readme",
|
|
12
15
|
"license": "MIT",
|
|
13
|
-
"main": "dist/index.js",
|
|
14
|
-
"module": "dist/index.mjs",
|
|
15
|
-
"types": "dist/index.d.ts",
|
|
16
16
|
"repository": "https://github.com/chakra-ui/zag/tree/main/packages/utilities/core",
|
|
17
17
|
"sideEffects": false,
|
|
18
18
|
"files": [
|