Is Deep Key
Checks if a given key is a deep key, containing a dot (.) or square brackets with a property accessor.
Category | Validations |
Author | Pol Gubau |
Since | 1.0.0 |
Last Updated | 2025-03-15 |
Type | Sync |
Compatibility | Universal |
Example
Input
isDeepKey('a.b')
Output:
true
Return
Returns true if the key is a deep key, otherwise false.
Type: boolean
Props
Name | Type | Default | Required | Description |
---|---|---|---|---|
key | PropertyKey | null | Yes | The 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