UNPKG

@technobuddha/library

Version:
16 lines (15 loc) 439 B
/** * Delete all own enumerable string properties from an object * * @remark The input argument is mutated in place * * @typeParam T Type of values within the object * @param input Object to clear all properties * @return Original {@code input} with all properties deleted. */ export function clearObject(input) { for (const key of Object.keys(input)) delete input[key]; return input; } export default clearObject;