UNPKG

@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 455 B
/** * Sets a value at a given path in an object, creating nested objects as needed. * @template T * @param {T} obj - The object to modify. * @param {string|string[]} path - The path to set (dot/bracket notation or array). * @param {any} value - The value to set. * @returns {T} The modified object. */ export default function set<T extends Record<PropertyKey, any>>(obj: T, path: string | string[], value: any): T; //# sourceMappingURL=set.d.ts.map