UNPKG

vike

Version:

The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.

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); }