• Removes any null values from an object in-place

    Type Parameters

    • T

    Parameters

    • obj: T

      Object reference that will be cleaned

    • undefinedOnly: boolean = false

      Ignore null values

    Returns Partial<T>

    Cleaned object

    let test = {a: 0, b: false, c: null, d: 'abc'}
    console.log(clean(test)); // Output: {a: 0, b: false, d: 'abc'}