Object
14 snippets
Deep Clone
VerifiedDeep-clones objects, arrays, Dates, Maps and Sets, including circular references.
Deep Merge
VerifiedDeeply merges objects into a new object without mutation and without prototype pollution.
Get Path
VerifiedSafely reads a nested value by a dot/bracket path with a fallback.
Omit
VerifiedReturns a new object without the given keys, fully typed.
Pick
VerifiedReturns a new object with only the given keys, fully typed.
Check if Object is Empty
Checks whether an object has no own enumerable properties.
Compare Two Objects Shallowly
Compares two objects shallowly and returns whether they are equal.
Convert Object to Query String
Converts an object to a query string for use in URLs.
Count Properties in Object
Counts the number of own properties in an object.
Filter Object
Filter out entries in an object where the value is falsy, including empty strings, empty objects, null, and undefined.
Flatten Nested Object
Flattens a nested object into a single-level object with dot notation for keys.
Freeze Object
Freezes an object to make it immutable.
Invert Object Keys and Values
Creates a new object by swapping keys and values of the given object.
Unique By Key
Filters an array of objects to only include unique objects by a specified key.