This package is a set of utilities that can be used both on server-side and client-side.
Can be used in switch statements to ensure we perform exhaustive checks.
Apply Object.freeze
to a value recursively and convert the return type to Readonly
variant recursively.
Retrieve the value for the specified path of an object.
Flatten a deeply nested object to a map of dot-separated paths, pointing to all of its primitive values and arrays.
Drop-in replacement for JSON.stringify
and JSON.parse
, capable of handling long numerals and BigInt
values.
Convert a map to an object.
Create a new Map
populated with the results of calling a provided function on every element in the input Map
.
Group elements of an Array
into a Map
based on a provided function.
Deeply merge two objects, omitting undefined values, and not deeply merging arrays.
Create a new Object
of specified keys and their values from an input Object
.
Apply a timeout
duration to a Promise
before throwing an Error
with the provided message.
Get a Promise
that resolves as soon as the first or last value arrives from an observable.
Unset a (potentially nested) key from given object.
Get an Object
resulting from applying a provided function to the meaningful parts of a URL.
Determine if a url is relative.
Get the origin URL of a provided URL.
Deeply validate that an Object
does not contain any __proto__
or constructor.prototype
keys, or circular references.