@utilify/core
Version:
Modern, strongly typed, and safe utility function library for JavaScript and TypeScript. Includes type checking, manipulation of arrays, objects, strings, dates, colors, numbers, regular expressions, and more. Compatible with Browser, Node.js, Deno, and B
10 lines • 517 B
TypeScript
/**
* Gets a value from an object at a given path, or returns a default value.
* @template T
* @param {T} obj - The object to query.
* @param {string|string[]} path - The path to get (dot/bracket notation or array).
* @param {any} [defaultValue] - The default value if the path does not exist.
* @returns {T} The value at the path or the default value.
*/
export default function get<T extends Record<PropertyKey, any>>(obj: T, path: string | string[], defaultValue?: any): T;
//# sourceMappingURL=get.d.ts.map