@nevware21/ts-utils
    Preparing search index...

    Function isUnsafeTarget

    • Checks whether the supplied target is a built-in prototype object.

      This helper can be used as an additional guard when assigning properties, to avoid mutating native prototype objects and reduce prototype pollution risk.

      Parameters

      • target: any

        The target object to validate.

      Returns boolean

      true when the target is a built-in prototype object; otherwise false.

      0.14.0

      isUnsafeTarget(Object.prototype);   // true
      isUnsafeTarget({}); // false