@zag-js/utils 1.26.4 → 1.27.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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -95,7 +95,7 @@ declare const toPx: (v: number | string | undefined) => string | undefined;
|
|
|
95
95
|
declare function compact<T extends Record<string, unknown> | undefined>(obj: T): T;
|
|
96
96
|
declare const json: (v: any) => any;
|
|
97
97
|
declare function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
98
|
-
type Dict = Record<string, any>;
|
|
98
|
+
type Dict = Record<string | symbol, any>;
|
|
99
99
|
declare function splitProps<T extends Dict>(props: T, keys: (keyof T)[]): Dict[];
|
|
100
100
|
declare const createSplitProps: <T extends Dict>(keys: (keyof T)[]) => <Props extends T>(props: Props) => [T, Omit<Props, keyof T>];
|
|
101
101
|
declare function omit<T extends Record<string, any>>(obj: T, keys: string[]): Omit<T, string | number>;
|
package/dist/index.d.ts
CHANGED
|
@@ -95,7 +95,7 @@ declare const toPx: (v: number | string | undefined) => string | undefined;
|
|
|
95
95
|
declare function compact<T extends Record<string, unknown> | undefined>(obj: T): T;
|
|
96
96
|
declare const json: (v: any) => any;
|
|
97
97
|
declare function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
98
|
-
type Dict = Record<string, any>;
|
|
98
|
+
type Dict = Record<string | symbol, any>;
|
|
99
99
|
declare function splitProps<T extends Dict>(props: T, keys: (keyof T)[]): Dict[];
|
|
100
100
|
declare const createSplitProps: <T extends Dict>(keys: (keyof T)[]) => <Props extends T>(props: Props) => [T, Omit<Props, keyof T>];
|
|
101
101
|
declare function omit<T extends Record<string, any>>(obj: T, keys: string[]): Omit<T, string | number>;
|
package/dist/index.js
CHANGED
|
@@ -362,7 +362,8 @@ function splitProps(props, keys) {
|
|
|
362
362
|
const rest = {};
|
|
363
363
|
const result = {};
|
|
364
364
|
const keySet = new Set(keys);
|
|
365
|
-
|
|
365
|
+
const ownKeys = Reflect.ownKeys(props);
|
|
366
|
+
for (const key of ownKeys) {
|
|
366
367
|
if (keySet.has(key)) {
|
|
367
368
|
result[key] = props[key];
|
|
368
369
|
} else {
|
package/dist/index.mjs
CHANGED
|
@@ -360,7 +360,8 @@ function splitProps(props, keys) {
|
|
|
360
360
|
const rest = {};
|
|
361
361
|
const result = {};
|
|
362
362
|
const keySet = new Set(keys);
|
|
363
|
-
|
|
363
|
+
const ownKeys = Reflect.ownKeys(props);
|
|
364
|
+
for (const key of ownKeys) {
|
|
364
365
|
if (keySet.has(key)) {
|
|
365
366
|
result[key] = props[key];
|
|
366
367
|
} else {
|