@pixpilot/object 1.2.0 → 2.1.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.cjs CHANGED
@@ -1 +1 @@
1
- const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./deep-merge.cjs`);require(`./delete-object-property-by-path.cjs`),require(`./get-object-value-by-path.cjs`),require(`./has-object-value-by-path.cjs`);const n=require(`./keys-to-camel-case.cjs`),r=require(`./keys-to-snake-case.cjs`),i=require(`./set-object-value-by-path.cjs`),a=require(`./manipulation.cjs`),o=require(`./type-guards.cjs`);let s=require(`dot-prop`);s=e.__toESM(s),exports.deepClone=a.deepClone,exports.deepEqual=a.deepEqual,exports.deepMerge=t.deepMerge,exports.deepMergeMany=t.deepMergeMany,exports.del=a.del,exports.deleteObjectPropertyByPath=s.deleteProperty,exports.escapePath=s.escapePath,exports.flatKeys=a.flatKeys,exports.get=a.get,exports.getObjectValueByPath=s.getProperty,exports.has=a.has,exports.hasObjectValueByPath=s.hasProperty,exports.isEmptyObject=o.isEmptyObject,exports.isObject=o.isObject,exports.isPlainObject=o.isPlainObject,exports.keysToCamelCase=n.keysToCamelCase,exports.keysToSnakeCase=r.keysToSnakeCase,exports.mapKeys=a.mapKeys,exports.mapValues=a.mapValues,exports.omit=a.omit,exports.parsePath=s.parsePath,exports.pick=a.pick,exports.set=a.set,exports.setObjectValueByPath=i.setObjectValueByPath,exports.setProperty=s.setProperty,exports.stringifyPath=s.stringifyPath,exports.unflatten=s.unflatten;
1
+ const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./deep-merge.cjs`);require(`./delete-object-property-by-path.cjs`),require(`./get-object-value-by-path.cjs`),require(`./has-object-value-by-path.cjs`);const n=require(`./keys-to-camel-case.cjs`),r=require(`./keys-to-snake-case.cjs`),i=require(`./manipulation.cjs`),a=require(`./set-object-value-by-path.cjs`),o=require(`./type-guards.cjs`);let s=require(`dot-prop`);s=e.__toESM(s),exports.deepClone=i.deepClone,exports.deepEqual=i.deepEqual,exports.deepMerge=t.deepMerge,exports.deepMergeMany=t.deepMergeMany,exports.deleteObjectPropertyByPath=s.deleteProperty,exports.deleteProperty=s.deleteProperty,exports.escapePath=s.escapePath,exports.flatKeys=i.flatKeys,exports.getObjectValueByPath=s.getProperty,exports.getProperty=s.getProperty,exports.hasObjectValueByPath=s.hasProperty,exports.hasProperty=s.hasProperty,exports.isEmptyObject=o.isEmptyObject,exports.isObject=o.isObject,exports.isPlainObject=o.isPlainObject,exports.keysToCamelCase=n.keysToCamelCase,exports.keysToSnakeCase=r.keysToSnakeCase,exports.mapKeys=i.mapKeys,exports.mapValues=i.mapValues,exports.omit=i.omit,exports.parsePath=s.parsePath,exports.pick=i.pick,exports.setObjectValueByPath=a.setObjectValueByPath,exports.setProperty=s.setProperty,exports.stringifyPath=s.stringifyPath,exports.unflatten=s.unflatten;
package/dist/index.d.cts CHANGED
@@ -4,7 +4,7 @@ import { getObjectValueByPath as getProperty } from "./get-object-value-by-path.
4
4
  import { hasObjectValueByPath as hasProperty } from "./has-object-value-by-path.cjs";
5
5
  import { KeysToCamelCase, ToCamelCase, keysToCamelCase } from "./keys-to-camel-case.cjs";
6
6
  import { KeysToSnakeCase, ToSnakeCase, keysToSnakeCase } from "./keys-to-snake-case.cjs";
7
+ import { deepClone, deepEqual, deleteProperty as deleteProperty$1, escapePath, flatKeys, getProperty as getProperty$1, hasProperty as hasProperty$1, mapKeys, mapValues, omit, parsePath, pick, setProperty, stringifyPath, unflatten } from "./manipulation.cjs";
7
8
  import { setObjectValueByPath } from "./set-object-value-by-path.cjs";
8
- import { deepClone, deepEqual, del, escapePath, flatKeys, get, has, mapKeys, mapValues, omit, parsePath, pick, set, setProperty, stringifyPath, unflatten } from "./manipulation.cjs";
9
9
  import { isEmptyObject, isObject, isPlainObject } from "./type-guards.cjs";
10
- export { KeysToCamelCase, KeysToSnakeCase, ToCamelCase, ToSnakeCase, deepClone, deepEqual, deepMerge, deepMergeMany, del, deleteProperty as deleteObjectPropertyByPath, escapePath, flatKeys, get, getProperty as getObjectValueByPath, has, hasProperty as hasObjectValueByPath, isEmptyObject, isObject, isPlainObject, keysToCamelCase, keysToSnakeCase, mapKeys, mapValues, omit, parsePath, pick, set, setObjectValueByPath, setProperty, stringifyPath, unflatten };
10
+ export { KeysToCamelCase, KeysToSnakeCase, ToCamelCase, ToSnakeCase, deepClone, deepEqual, deepMerge, deepMergeMany, deleteProperty as deleteObjectPropertyByPath, deleteProperty$1 as deleteProperty, escapePath, flatKeys, getProperty as getObjectValueByPath, getProperty$1 as getProperty, hasProperty as hasObjectValueByPath, hasProperty$1 as hasProperty, isEmptyObject, isObject, isPlainObject, keysToCamelCase, keysToSnakeCase, mapKeys, mapValues, omit, parsePath, pick, setObjectValueByPath, setProperty, stringifyPath, unflatten };
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { getObjectValueByPath as getProperty } from "./get-object-value-by-path.
4
4
  import { hasObjectValueByPath as hasProperty } from "./has-object-value-by-path.js";
5
5
  import { KeysToCamelCase, ToCamelCase, keysToCamelCase } from "./keys-to-camel-case.js";
6
6
  import { KeysToSnakeCase, ToSnakeCase, keysToSnakeCase } from "./keys-to-snake-case.js";
7
+ import { deepClone, deepEqual, deleteProperty as deleteProperty$1, escapePath, flatKeys, getProperty as getProperty$1, hasProperty as hasProperty$1, mapKeys, mapValues, omit, parsePath, pick, setProperty, stringifyPath, unflatten } from "./manipulation.js";
7
8
  import { setObjectValueByPath } from "./set-object-value-by-path.js";
8
- import { deepClone, deepEqual, del, escapePath, flatKeys, get, has, mapKeys, mapValues, omit, parsePath, pick, set, setProperty, stringifyPath, unflatten } from "./manipulation.js";
9
9
  import { isEmptyObject, isObject, isPlainObject } from "./type-guards.js";
10
- export { KeysToCamelCase, KeysToSnakeCase, ToCamelCase, ToSnakeCase, deepClone, deepEqual, deepMerge, deepMergeMany, del, deleteProperty as deleteObjectPropertyByPath, escapePath, flatKeys, get, getProperty as getObjectValueByPath, has, hasProperty as hasObjectValueByPath, isEmptyObject, isObject, isPlainObject, keysToCamelCase, keysToSnakeCase, mapKeys, mapValues, omit, parsePath, pick, set, setObjectValueByPath, setProperty, stringifyPath, unflatten };
10
+ export { KeysToCamelCase, KeysToSnakeCase, ToCamelCase, ToSnakeCase, deepClone, deepEqual, deepMerge, deepMergeMany, deleteProperty as deleteObjectPropertyByPath, deleteProperty$1 as deleteProperty, escapePath, flatKeys, getProperty as getObjectValueByPath, getProperty$1 as getProperty, hasProperty as hasObjectValueByPath, hasProperty$1 as hasProperty, isEmptyObject, isObject, isPlainObject, keysToCamelCase, keysToSnakeCase, mapKeys, mapValues, omit, parsePath, pick, setObjectValueByPath, setProperty, stringifyPath, unflatten };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{deepMerge as e,deepMergeMany as t}from"./deep-merge.js";import{deleteObjectPropertyByPath as n}from"./delete-object-property-by-path.js";import{getObjectValueByPath as r}from"./get-object-value-by-path.js";import{hasObjectValueByPath as i}from"./has-object-value-by-path.js";import{keysToCamelCase as a}from"./keys-to-camel-case.js";import{keysToSnakeCase as o}from"./keys-to-snake-case.js";import{setObjectValueByPath as s}from"./set-object-value-by-path.js";import{deepClone as c,deepEqual as l,del as u,escapePath as d,flatKeys as f,get as p,has as m,mapKeys as h,mapValues as g,omit as _,parsePath as v,pick as y,set as b,setProperty as x,stringifyPath as S,unflatten as C}from"./manipulation.js";import{isEmptyObject as w,isObject as T,isPlainObject as E}from"./type-guards.js";export{c as deepClone,l as deepEqual,e as deepMerge,t as deepMergeMany,u as del,n as deleteObjectPropertyByPath,d as escapePath,f as flatKeys,p as get,r as getObjectValueByPath,m as has,i as hasObjectValueByPath,w as isEmptyObject,T as isObject,E as isPlainObject,a as keysToCamelCase,o as keysToSnakeCase,h as mapKeys,g as mapValues,_ as omit,v as parsePath,y as pick,b as set,s as setObjectValueByPath,x as setProperty,S as stringifyPath,C as unflatten};
1
+ import{deepMerge as e,deepMergeMany as t}from"./deep-merge.js";import{deleteObjectPropertyByPath as n}from"./delete-object-property-by-path.js";import{getObjectValueByPath as r}from"./get-object-value-by-path.js";import{hasObjectValueByPath as i}from"./has-object-value-by-path.js";import{keysToCamelCase as a}from"./keys-to-camel-case.js";import{keysToSnakeCase as o}from"./keys-to-snake-case.js";import{deepClone as s,deepEqual as c,deleteProperty as l,escapePath as u,flatKeys as d,getProperty as f,hasProperty as p,mapKeys as m,mapValues as h,omit as g,parsePath as _,pick as v,setProperty as y,stringifyPath as b,unflatten as x}from"./manipulation.js";import{setObjectValueByPath as S}from"./set-object-value-by-path.js";import{isEmptyObject as C,isObject as w,isPlainObject as T}from"./type-guards.js";export{s as deepClone,c as deepEqual,e as deepMerge,t as deepMergeMany,n as deleteObjectPropertyByPath,l as deleteProperty,u as escapePath,d as flatKeys,r as getObjectValueByPath,f as getProperty,i as hasObjectValueByPath,p as hasProperty,C as isEmptyObject,w as isObject,T as isPlainObject,a as keysToCamelCase,o as keysToSnakeCase,m as mapKeys,h as mapValues,g as omit,_ as parsePath,v as pick,S as setObjectValueByPath,y as setProperty,b as stringifyPath,x as unflatten};
@@ -1,6 +1,17 @@
1
1
  //#region src/keys-to-camel-case.d.ts
2
- type ToCamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}` ? `${P1}${Uppercase<P2>}${ToCamelCase<P3>}` : S;
3
- type KeysToCamelCase<T> = { [K in keyof T as ToCamelCase<string & K>]: T[K] extends Record<string, unknown> ? KeysToCamelCase<T[K]> : T[K] extends readonly (infer U)[] ? U extends Record<string, unknown> ? readonly KeysToCamelCase<U>[] : T[K] : T[K] };
4
- declare function keysToCamelCase<T>(obj: T): T extends Record<string, unknown> ? KeysToCamelCase<T> : T;
2
+ type CamelizeSegment<S extends string> = S extends '' ? '' : Capitalize<Lowercase<S>>;
3
+ /**
4
+ * Convert snake_case to camelCase at the type level.
5
+ *
6
+ * This intentionally matches the runtime behavior of `change-case`'s `camelCase`
7
+ * for underscores:
8
+ * - ignores leading/consecutive underscores
9
+ * - lowercases words
10
+ */
11
+ type ToCamelCase<S extends string, IsFirst extends boolean = true> = S extends `${infer Head}_${infer Tail}` ? Head extends '' ? ToCamelCase<Tail, IsFirst> : `${IsFirst extends true ? Lowercase<Head> : CamelizeSegment<Head>}${ToCamelCase<Tail, false>}` : S extends '' ? '' : IsFirst extends true ? Lowercase<S> : CamelizeSegment<S>;
12
+ type Builtin = Date | RegExp | Map<unknown, unknown> | Set<unknown> | WeakMap<object, unknown> | WeakSet<object>;
13
+ type TupleToCamelCase<T extends readonly unknown[]> = { [I in keyof T]: KeysToCamelCase<T[I]> };
14
+ type KeysToCamelCase<T> = T extends Builtin ? T : T extends ((...args: unknown[]) => unknown) ? T : T extends readonly unknown[] ? number extends T['length'] ? KeysToCamelCase<T[number]>[] : TupleToCamelCase<T> : T extends object ? { [K in keyof T as K extends string ? ToCamelCase<K> : K]: KeysToCamelCase<T[K]> } : T;
15
+ declare function keysToCamelCase<T>(obj: T): KeysToCamelCase<T>;
5
16
  //#endregion
6
17
  export { KeysToCamelCase, ToCamelCase, keysToCamelCase };
@@ -1,6 +1,17 @@
1
1
  //#region src/keys-to-camel-case.d.ts
2
- type ToCamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}` ? `${P1}${Uppercase<P2>}${ToCamelCase<P3>}` : S;
3
- type KeysToCamelCase<T> = { [K in keyof T as ToCamelCase<string & K>]: T[K] extends Record<string, unknown> ? KeysToCamelCase<T[K]> : T[K] extends readonly (infer U)[] ? U extends Record<string, unknown> ? readonly KeysToCamelCase<U>[] : T[K] : T[K] };
4
- declare function keysToCamelCase<T>(obj: T): T extends Record<string, unknown> ? KeysToCamelCase<T> : T;
2
+ type CamelizeSegment<S extends string> = S extends '' ? '' : Capitalize<Lowercase<S>>;
3
+ /**
4
+ * Convert snake_case to camelCase at the type level.
5
+ *
6
+ * This intentionally matches the runtime behavior of `change-case`'s `camelCase`
7
+ * for underscores:
8
+ * - ignores leading/consecutive underscores
9
+ * - lowercases words
10
+ */
11
+ type ToCamelCase<S extends string, IsFirst extends boolean = true> = S extends `${infer Head}_${infer Tail}` ? Head extends '' ? ToCamelCase<Tail, IsFirst> : `${IsFirst extends true ? Lowercase<Head> : CamelizeSegment<Head>}${ToCamelCase<Tail, false>}` : S extends '' ? '' : IsFirst extends true ? Lowercase<S> : CamelizeSegment<S>;
12
+ type Builtin = Date | RegExp | Map<unknown, unknown> | Set<unknown> | WeakMap<object, unknown> | WeakSet<object>;
13
+ type TupleToCamelCase<T extends readonly unknown[]> = { [I in keyof T]: KeysToCamelCase<T[I]> };
14
+ type KeysToCamelCase<T> = T extends Builtin ? T : T extends ((...args: unknown[]) => unknown) ? T : T extends readonly unknown[] ? number extends T['length'] ? KeysToCamelCase<T[number]>[] : TupleToCamelCase<T> : T extends object ? { [K in keyof T as K extends string ? ToCamelCase<K> : K]: KeysToCamelCase<T[K]> } : T;
15
+ declare function keysToCamelCase<T>(obj: T): KeysToCamelCase<T>;
5
16
  //#endregion
6
17
  export { KeysToCamelCase, ToCamelCase, keysToCamelCase };
@@ -1,9 +1,17 @@
1
1
  //#region src/keys-to-snake-case.d.ts
2
- type ToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? `${T extends Uppercase<T> ? '_' : ''}${Lowercase<T>}${ToSnakeCase<U>}` : S;
3
- type KeysToSnakeCase<T$1> = { [K in keyof T$1 as ToSnakeCase<string & K>]: T$1[K] extends Record<string, unknown> ? KeysToSnakeCase<T$1[K]> : T$1[K] extends readonly (infer U)[] ? U extends Record<string, unknown> ? readonly KeysToSnakeCase<U>[] : T$1[K] : T$1[K] };
2
+ /**
3
+ * Convert camelCase to snake_case at the type level.
4
+ *
5
+ * This intentionally matches the runtime behavior of `change-case`'s `snakeCase`
6
+ * for camelCase conversion: inserts underscores before uppercase letters and lowercases.
7
+ */
8
+ type ToSnakeCase<S extends string> = S extends `${infer P1}${infer P2}${infer P3}` ? P1 extends Lowercase<P1> ? P2 extends Uppercase<P2> ? `${P1}_${ToSnakeCase<`${Lowercase<P2>}${P3}`>}` : `${P1}${ToSnakeCase<`${P2}${P3}`>}` : S : S;
9
+ type Builtin = Date | RegExp | Map<unknown, unknown> | Set<unknown> | WeakMap<object, unknown> | WeakSet<object>;
10
+ type TupleToSnakeCase<T extends readonly unknown[]> = { [I in keyof T]: KeysToSnakeCase<T[I]> };
11
+ type KeysToSnakeCase<T> = T extends Builtin ? T : T extends ((...args: unknown[]) => unknown) ? T : T extends readonly unknown[] ? number extends T['length'] ? KeysToSnakeCase<T[number]>[] : TupleToSnakeCase<T> : T extends object ? { [K in keyof T as K extends string ? ToSnakeCase<K> : K]: KeysToSnakeCase<T[K]> } : T;
4
12
  /**
5
13
  * Converts object keys from camelCase to snake_case recursively
6
14
  */
7
- declare function keysToSnakeCase<T$1>(obj: T$1): T$1 extends Record<string, unknown> ? KeysToSnakeCase<T$1> : T$1;
15
+ declare function keysToSnakeCase<T>(obj: T): KeysToSnakeCase<T>;
8
16
  //#endregion
9
17
  export { KeysToSnakeCase, ToSnakeCase, keysToSnakeCase };
@@ -1,9 +1,17 @@
1
1
  //#region src/keys-to-snake-case.d.ts
2
- type ToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? `${T extends Uppercase<T> ? '_' : ''}${Lowercase<T>}${ToSnakeCase<U>}` : S;
3
- type KeysToSnakeCase<T$1> = { [K in keyof T$1 as ToSnakeCase<string & K>]: T$1[K] extends Record<string, unknown> ? KeysToSnakeCase<T$1[K]> : T$1[K] extends readonly (infer U)[] ? U extends Record<string, unknown> ? readonly KeysToSnakeCase<U>[] : T$1[K] : T$1[K] };
2
+ /**
3
+ * Convert camelCase to snake_case at the type level.
4
+ *
5
+ * This intentionally matches the runtime behavior of `change-case`'s `snakeCase`
6
+ * for camelCase conversion: inserts underscores before uppercase letters and lowercases.
7
+ */
8
+ type ToSnakeCase<S extends string> = S extends `${infer P1}${infer P2}${infer P3}` ? P1 extends Lowercase<P1> ? P2 extends Uppercase<P2> ? `${P1}_${ToSnakeCase<`${Lowercase<P2>}${P3}`>}` : `${P1}${ToSnakeCase<`${P2}${P3}`>}` : S : S;
9
+ type Builtin = Date | RegExp | Map<unknown, unknown> | Set<unknown> | WeakMap<object, unknown> | WeakSet<object>;
10
+ type TupleToSnakeCase<T extends readonly unknown[]> = { [I in keyof T]: KeysToSnakeCase<T[I]> };
11
+ type KeysToSnakeCase<T> = T extends Builtin ? T : T extends ((...args: unknown[]) => unknown) ? T : T extends readonly unknown[] ? number extends T['length'] ? KeysToSnakeCase<T[number]>[] : TupleToSnakeCase<T> : T extends object ? { [K in keyof T as K extends string ? ToSnakeCase<K> : K]: KeysToSnakeCase<T[K]> } : T;
4
12
  /**
5
13
  * Converts object keys from camelCase to snake_case recursively
6
14
  */
7
- declare function keysToSnakeCase<T$1>(obj: T$1): T$1 extends Record<string, unknown> ? KeysToSnakeCase<T$1> : T$1;
15
+ declare function keysToSnakeCase<T>(obj: T): KeysToSnakeCase<T>;
8
16
  //#endregion
9
17
  export { KeysToSnakeCase, ToSnakeCase, keysToSnakeCase };
@@ -1 +1 @@
1
- const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./set-object-value-by-path.cjs`);let n=require(`dot-prop`);n=e.__toESM(n);function r(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function i(e,t){let n={...e};for(let e of t)delete n[e];return n}function a(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e))return e.map(e=>a(e));let t={};for(let[n,r]of Object.entries(e))t[n]=a(r);return t}function o(e,t){if(e===t)return!0;if(typeof e!=typeof t||e===null||t===null)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length?e.every((e,n)=>o(e,t[n])):!1;if(typeof e==`object`&&typeof t==`object`){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>o(e[n],t[n])):!1}return!1}function s(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=t(i,r);return n}function c(e,t){let n={};for(let[r,i]of Object.entries(e)){let e=t(r);n[e]=i}return n}const l=n.getProperty,u=t.setObjectValueByPath,d=n.hasProperty,f=n.deleteProperty,p=n.deepKeys;exports.deepClone=a,exports.deepEqual=o,exports.del=f,exports.escapePath=n.escapePath,exports.flatKeys=p,exports.get=l,exports.has=d,exports.mapKeys=c,exports.mapValues=s,exports.omit=i,exports.parsePath=n.parsePath,exports.pick=r,exports.set=u,exports.setProperty=n.setProperty,exports.stringifyPath=n.stringifyPath,exports.unflatten=n.unflatten;
1
+ const e=require(`./_virtual/rolldown_runtime.cjs`);let t=require(`dot-prop`);t=e.__toESM(t);function n(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function r(e,t){let n={...e};for(let e of t)delete n[e];return n}function i(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e))return e.map(e=>i(e));let t={};for(let[n,r]of Object.entries(e))t[n]=i(r);return t}function a(e,t){if(e===t)return!0;if(typeof e!=typeof t||e===null||t===null)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length?e.every((e,n)=>a(e,t[n])):!1;if(typeof e==`object`&&typeof t==`object`){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>a(e[n],t[n])):!1}return!1}function o(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=t(i,r);return n}function s(e,t){let n={};for(let[r,i]of Object.entries(e)){let e=t(r);n[e]=i}return n}const c=t.deepKeys;exports.deepClone=i,exports.deepEqual=a,exports.deleteProperty=t.deleteProperty,exports.escapePath=t.escapePath,exports.flatKeys=c,exports.getProperty=t.getProperty,exports.hasProperty=t.hasProperty,exports.mapKeys=s,exports.mapValues=o,exports.omit=r,exports.parsePath=t.parsePath,exports.pick=n,exports.setProperty=t.setProperty,exports.stringifyPath=t.stringifyPath,exports.unflatten=t.unflatten;
@@ -1,4 +1,3 @@
1
- import { setObjectValueByPath } from "./set-object-value-by-path.cjs";
2
1
  import { deepKeys, deleteProperty, escapePath, getProperty, hasProperty, parsePath, setProperty, stringifyPath, unflatten } from "dot-prop";
3
2
 
4
3
  //#region src/manipulation.d.ts
@@ -88,10 +87,6 @@ declare function mapValues<T extends Record<string, unknown>, U>(obj: T, fn: (va
88
87
  * ```
89
88
  */
90
89
  declare function mapKeys<T extends Record<string, unknown>>(obj: T, fn: (key: keyof T) => string): Record<string, T[keyof T]>;
91
- declare const get: typeof getProperty;
92
- declare const set: typeof setObjectValueByPath;
93
- declare const has: typeof hasProperty;
94
- declare const del: typeof deleteProperty;
95
90
  declare const flatKeys: typeof deepKeys;
96
91
  //#endregion
97
- export { deepClone, deepEqual, del, escapePath, flatKeys, get, has, mapKeys, mapValues, omit, parsePath, pick, set, setProperty, stringifyPath, unflatten };
92
+ export { deepClone, deepEqual, deleteProperty, escapePath, flatKeys, getProperty, hasProperty, mapKeys, mapValues, omit, parsePath, pick, setProperty, stringifyPath, unflatten };
@@ -1,4 +1,3 @@
1
- import { setObjectValueByPath } from "./set-object-value-by-path.js";
2
1
  import { deepKeys, deleteProperty, escapePath, getProperty, hasProperty, parsePath, setProperty, stringifyPath, unflatten } from "dot-prop";
3
2
 
4
3
  //#region src/manipulation.d.ts
@@ -88,10 +87,6 @@ declare function mapValues<T extends Record<string, unknown>, U>(obj: T, fn: (va
88
87
  * ```
89
88
  */
90
89
  declare function mapKeys<T extends Record<string, unknown>>(obj: T, fn: (key: keyof T) => string): Record<string, T[keyof T]>;
91
- declare const get: typeof getProperty;
92
- declare const set: typeof setObjectValueByPath;
93
- declare const has: typeof hasProperty;
94
- declare const del: typeof deleteProperty;
95
90
  declare const flatKeys: typeof deepKeys;
96
91
  //#endregion
97
- export { deepClone, deepEqual, del, escapePath, flatKeys, get, has, mapKeys, mapValues, omit, parsePath, pick, set, setProperty, stringifyPath, unflatten };
92
+ export { deepClone, deepEqual, deleteProperty, escapePath, flatKeys, getProperty, hasProperty, mapKeys, mapValues, omit, parsePath, pick, setProperty, stringifyPath, unflatten };
@@ -1 +1 @@
1
- import{setObjectValueByPath as e}from"./set-object-value-by-path.js";import{deepKeys as t,deleteProperty as n,escapePath as r,getProperty as i,hasProperty as a,parsePath as o,setProperty as s,stringifyPath as c,unflatten as l}from"dot-prop";function u(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function d(e,t){let n={...e};for(let e of t)delete n[e];return n}function f(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e))return e.map(e=>f(e));let t={};for(let[n,r]of Object.entries(e))t[n]=f(r);return t}function p(e,t){if(e===t)return!0;if(typeof e!=typeof t||e===null||t===null)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length?e.every((e,n)=>p(e,t[n])):!1;if(typeof e==`object`&&typeof t==`object`){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>p(e[n],t[n])):!1}return!1}function m(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=t(i,r);return n}function h(e,t){let n={};for(let[r,i]of Object.entries(e)){let e=t(r);n[e]=i}return n}const g=i,_=e,v=a,y=n,b=t;export{f as deepClone,p as deepEqual,y as del,r as escapePath,b as flatKeys,g as get,v as has,h as mapKeys,m as mapValues,d as omit,o as parsePath,u as pick,_ as set,s as setProperty,c as stringifyPath,l as unflatten};
1
+ import{deepKeys as e,deleteProperty as t,escapePath as n,getProperty as r,hasProperty as i,parsePath as a,setProperty as o,stringifyPath as s,unflatten as c}from"dot-prop";function l(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function u(e,t){let n={...e};for(let e of t)delete n[e];return n}function d(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e))return e.map(e=>d(e));let t={};for(let[n,r]of Object.entries(e))t[n]=d(r);return t}function f(e,t){if(e===t)return!0;if(typeof e!=typeof t||e===null||t===null)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length?e.every((e,n)=>f(e,t[n])):!1;if(typeof e==`object`&&typeof t==`object`){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>f(e[n],t[n])):!1}return!1}function p(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=t(i,r);return n}function m(e,t){let n={};for(let[r,i]of Object.entries(e)){let e=t(r);n[e]=i}return n}const h=e;export{d as deepClone,f as deepEqual,t as deleteProperty,n as escapePath,h as flatKeys,r as getProperty,i as hasProperty,m as mapKeys,p as mapValues,u as omit,a as parsePath,l as pick,o as setProperty,s as stringifyPath,c as unflatten};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixpilot/object",
3
3
  "type": "module",
4
- "version": "1.2.0",
4
+ "version": "2.1.0",
5
5
  "description": "A collection of utility functions for object manipulation and transformation.",
6
6
  "author": "Pixpilot <m.doaie@hotmail.com>",
7
7
  "license": "MIT",
@@ -37,8 +37,8 @@
37
37
  "typescript": "^5.9.3",
38
38
  "@internal/eslint-config": "0.3.0",
39
39
  "@internal/prettier-config": "0.0.1",
40
- "@internal/tsconfig": "0.1.0",
41
40
  "@internal/vitest-config": "0.1.0",
41
+ "@internal/tsconfig": "0.1.0",
42
42
  "@internal/tsdown-config": "0.1.0"
43
43
  },
44
44
  "prettier": "@internal/prettier-config",