schema-components - v3.7.0
    Preparing search index...

    Function renameRecordKey

    • Rename a key in an object while preserving insertion order. Returns the original object reference when the rename is a no-op (oldKey === newKey) or when newKey collides with an existing key.

      Parameters

      • obj: Record<string, unknown>
      • oldKey: string
      • newKey: string

      Returns Record<string, unknown>