vlocode-project - v1.40.0-beta-4
    Preparing search index...

    Function filterObject

    • Return a new object that only has the properties that match the specified predicate.

      Optionally the predicate can be specified to be recursive; if the predicate returns a trueish value for a property that is an object and the recursive option is specified the object will be filtered recursively. The recursive option defaults to false.

      Type Parameters

      • T extends object

      Parameters

      • obj: T

        Object to evaluate

      • predicate: (key: string, value: any, obj: T) => boolean

        Predicate which when true means the property is included otherwise the property is excluded

      • Optionaloptions: { recursive?: boolean }

      Returns T

      New object with only the properties for which the predicate returned a trueish value