/** * Mock response utils. */ import set from 'lodash/set'; /** * Patches object by provided set of keyPath and value pairs. */ export function patchObject( obj?: Record | null, patchSchema?: Record, ) { if (obj && typeof obj === 'object' && patchSchema) { Object.keys(patchSchema).forEach((keyPath) => { set(obj, keyPath, patchSchema[keyPath]); }); } } export async function wait(ms: number) { return new Promise((resolve) => setTimeout(resolve, ms)); }