UNPKG

inreplace

Version:
12 lines (11 loc) 479 B
export type InreplaceHandle = { restore: () => void; }; export type InreplaceOptions = { /** * By default the function will throw when encountering a non-configurable property in the target object. * With this option set to true the function will instead leave those properties untouched. */ allowNonConfigurable?: boolean; }; export default function inreplace<T extends object>(target: T, source: object, options?: InreplaceOptions): InreplaceHandle;