Function objDefineProps

  • The objDefineProps() method defines new or modifies existing properties directly for the target object using the keys and configuration from the propDescMap argument. This will call objDefineProperties after creating the required PropertyDescriptorMap from the propDescMap values. Note, the default values (true) for configurable and enumerable are different from the defaults provided by objDefineProperties.

    Type Parameters

    • T

    Parameters

    • target: T

      The object on which to define or modify properties.

    • propDescMap: ObjDefinePropDescriptorMap

      An object whose keys represent the names of properties to be defined or modified and whose values are objects describing those properties. Each value in props must be either a data descriptor or an accessor descriptor; it cannot be both (see ObjDefinePropDescriptorMap for more details).

    Returns T

    The target object.

    Since

    0.6.0