UNPKG

@polgubau/utils

Version:

A collection of utility functions for TypeScript

21 lines (19 loc) 547 B
/** * Checks if a given key is a deep key. * * A deep key is a string that contains a dot (.) or square brackets with a property accessor. * * @param {PropertyKey} key - The key to check. * @returns {boolean} - Returns true if the key is a deep key, otherwise false. * * Examples: * * isDeepKey('a.b') // true * isDeepKey('a[b]') // true * isDeepKey('a') // false * isDeepKey(123) // false * isDeepKey('a.b.c') // true * isDeepKey('a[b][c]') // true */ declare function isDeepKey(key: PropertyKey): boolean; export { isDeepKey };