Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/samualtnorman/lib. A collection of common utilities I need. www.npmjs.com/package/@samual/lib
Something went wrong. Try again.
1234567891011121314export function clearObject( object: Record<string | symbol, any>, prototype?: object | null): asserts object is Record<string | symbol, unknown> { for (const propertyName of Object.getOwnPropertyNames(object)) delete object[propertyName]
for (const propertySymbol of Object.getOwnPropertySymbols(object)) delete object[propertySymbol]
if (prototype !== undefined) Object.setPrototypeOf(object, prototype)}