Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
type FormatKey = (key: string) => string;
-function deepClone<I extends CloneableData, O extends CloneableData = I>(
+const deepClone = <I extends CloneableData, O extends CloneableData = I>(
value: I,
formatKey?: FormatKey,
refs: Map<I, O> = new Map<I, O>(),
-): O {
+): O => {
const ref = refs.get(value);
if (ref !== undefined) {
return ref;
);
}
return clone as O;
-}
+};
export const cloneObject = <T>(object: T): T => {
return deepClone(object as CloneableData) as T;