PruvoNet/squiss-ts

View on GitHub
src/Utils.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
export const removeEmptyKeys = <T extends object>(obj: T): T => {
    (Object.keys(obj) as (keyof typeof obj)[]).forEach((key) => {
        if (obj[key] === undefined) {
            delete obj[key];
        }
    });
    return obj;
};