@vitus-labs/core 2.6.2 → 2.7.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/lib/index.d.ts CHANGED
@@ -322,7 +322,7 @@ declare const render: Render;
322
322
  declare const useStableValue: <T>(value: T) => T;
323
323
  //#endregion
324
324
  //#region src/utils.d.ts
325
- declare const omit: <T extends Record<string, any>>(obj: T | null | undefined, keys?: readonly (string | keyof T)[]) => Partial<T>;
325
+ declare const omit: <T extends Record<string, any>>(obj: T | null | undefined, keys?: readonly (string | keyof T)[] | ReadonlySet<string | keyof T>) => Partial<T>;
326
326
  declare const pick: <T extends Record<string, any>>(obj: T | null | undefined, keys?: readonly (string | keyof T)[]) => Partial<T>;
327
327
  declare const get: (obj: any, path: string | string[], defaultValue?: any) => any;
328
328
  declare const set: (obj: Record<string, any>, path: string | string[], value: any) => Record<string, any>;
package/lib/index.js CHANGED
@@ -453,9 +453,10 @@ const render = (content, attachProps) => {
453
453
  //#region src/utils.ts
454
454
  const omit = (obj, keys) => {
455
455
  if (obj == null) return {};
456
- if (!keys || keys.length === 0) return { ...obj };
456
+ if (!keys) return { ...obj };
457
+ const keysSet = keys instanceof Set ? keys : new Set(keys);
458
+ if (keysSet.size === 0) return { ...obj };
457
459
  const result = {};
458
- const keysSet = new Set(keys);
459
460
  for (const key in obj) if (Object.hasOwn(obj, key) && !keysSet.has(key)) result[key] = obj[key];
460
461
  return result;
461
462
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitus-labs/core",
3
- "version": "2.6.2",
3
+ "version": "2.7.0",
4
4
  "license": "MIT",
5
5
  "author": "Vit Bokisch <vit@bokisch.cz>",
6
6
  "maintainers": [
@@ -59,7 +59,7 @@
59
59
  "react-is": "^19.2.4"
60
60
  },
61
61
  "devDependencies": {
62
- "@vitus-labs/tools-rolldown": "2.3.1",
63
- "@vitus-labs/tools-typescript": "2.3.1"
62
+ "@vitus-labs/tools-rolldown": "2.5.0",
63
+ "@vitus-labs/tools-typescript": "2.5.0"
64
64
  }
65
65
  }