UNPKG

@n3okill/utils

Version:
10 lines (9 loc) 505 B
/** * Set a property in an object * @param obj The object where to set the property * @param {string | Array<string>} name The name of the property can be on the form "a.b.c[1].d" * @param value The value to be defined for the property * @param {boolean} replace If true will replace the property if it already exists * @returns The original object (just for chaining purposes) */ export declare function setProperty(obj: any, name: string | Array<string>, value: unknown, replace?: boolean): any;