UNPKG

validated-changeset

Version:
25 lines 593 B
/** * traverse through target and unset `value` from leaf key so can access normally * { * name: Change { * value: 'Charles' * } * } * * to * * { * name: 'Charles' * } * * Shallow copy here is fine because we are swapping out the leaf nested object * rather than mutating a property in something with reference * * @method normalizeObject * @param {Object} target * @return {Object} */ export default function normalizeObject<T extends { [key: string]: any; }>(target: T, isObj?: (...args: unknown[]) => unknown): T; //# sourceMappingURL=normalize-object.d.ts.map