Is Deep Key

Checks if a given key is a deep key, containing a dot (.) or square brackets with a property accessor.

CategoryValidations
AuthorPol Gubau
Since1.0.0
Last Updated2025-03-15
TypeSync
CompatibilityUniversal

Example

  • Input

    isDeepKey('a.b')

    Output:

    true

Return

Returns true if the key is a deep key, otherwise false.

Type: boolean

Props

NameTypeDefaultRequiredDescription
keyPropertyKeynullYesThe key to check, can be a string or symbol.

Notes

Deep keys are typically used for nested object properties, e.g., 'a.b' or 'a[b]'.

Tags

  • deep key
  • key
  • property