@pengzhanbo/utils - v3.4.1
    Preparing search index...

    Function clearUndefined

    • Remove keys with undefined values from an object

      从对象中删除值为 undefined 的键

      Type Parameters

      • T extends object

      Parameters

      • obj: T

        The object to remove undefined keys from 要删除值为 undefined 键的对象

      Returns T

      The object with undefined keys removed 移除了值为 undefined 键的对象

      const obj = { a: 1, b: undefined }
      clearUndefined(obj) // { a: 1 }