UNPKG

@cookbook/dot-notation

Version:

Object readings and complex transformations using dot notation syntax.

21 lines (18 loc) 547 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; /** * Ger Array Index * @description get array index from dot notation path string * @param {string} str * @return {RegExpExecArray|null} */ var getArrayIndex = function getArrayIndex(str) { return getArrayIndex.regexpNaNIndex.exec(str) || getArrayIndex.regexpIntIndex.exec(str); }; getArrayIndex.regexpIntIndex = /\[(-*\d*)]/g; getArrayIndex.regexpNaNIndex = /\[([^\]]*)]/; var _default = getArrayIndex; exports.default = _default;