UNPKG

@cookbook/dot-notation

Version:

Object readings and complex transformations using dot notation syntax.

7 lines 288 B
const getKey = (value) => { const [current, ...remaining] = value.split(getKey.regexp).filter(Boolean); return [current, remaining.length ? remaining.join('.') : undefined]; }; getKey.regexp = /\.|(\[[^\]]*])|(\[-*\d*])/; export default getKey; //# sourceMappingURL=get-key.js.map