Library API
    Preparing search index...

    Function isSafeKey

    • Asserts if a property key is safe against prototype pollution and prototype hijacking. Returns false for 'proto', 'constructor', and 'prototype'.

      Parameters

      • key: PropertyKey

        The property key to check

      Returns boolean

      True if the key is safe to assign or merge

      isSafeKey('name'); // true
      isSafeKey('__proto__'); // false