• Recursively filters out a specified property from an object or array of objects.

    Type Parameters

    Parameters

    • obj: T

      The object or array of objects to filter.

    • keyToRemove: K

      The key of the property to remove.

    • Optionaloptions: {
          force?: boolean;
          onlyEnumerable?: boolean;
          onlyNonFunctions?: boolean;
          onlyNonProto?: boolean;
          useKeysInsteadOfGetOwnPropertyNames?: boolean;
      }

      Optional settings.

      • Optionalforce?: boolean

        If true, it forces the function to filter the properties of the value passed into the obj parameter, even if it is not an object. Defaults to false.

      • OptionalonlyEnumerable?: boolean

        If true, it forces the function to only do recursive checking on enumerable properties. Defaults to false.

      • OptionalonlyNonFunctions?: boolean

        If true, it forces the function to only do recursive checking on non-function properties. Defaults to true.

      • OptionalonlyNonProto?: boolean

        If true, it forces the function to only do recursive checking on properties that are not in the proto property. Defaults to true.

      • OptionaluseKeysInsteadOfGetOwnPropertyNames?: boolean

        If true, uses Object.keys instead of Object.getOwnPropertyNames to get the properties of the object. Defaults to false.

    Returns FilterKey<T, K>

    • The filtered object or array of objects without the specified property.