UNPKG

vike

Version:

(Replaces Next.js/Nuxt) 🔨 Composable framework to build advanced applications with flexibility and stability.

7 lines (6 loc) • 244 B
export function getPropAccessNotation(key) { return typeof key === 'string' && isKeyDotNotationCompatible(key) ? `.${key}` : `[${JSON.stringify(key)}]`; } function isKeyDotNotationCompatible(key) { return /^[a-z0-9\$_]+$/i.test(key); }