@technobuddha/library
Version:
A large library of useful functions
16 lines (15 loc) • 439 B
JavaScript
/**
* 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;