MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / parseKeys

Function parseKeys

out/cli.cjs:28514–28549  ·  view source on GitHub ↗
(givenKey, val, options, valuesParsed)

Source from the content-addressed store, hash-verified

28512 return leaf;
28513 };
28514 var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
28515 if (!givenKey) {
28516 return;
28517 }
28518 var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
28519 var brackets = /(\[[^[\]]*])/;
28520 var child = /(\[[^[\]]*])/g;
28521 var segment = options.depth > 0 && brackets.exec(key);
28522 var parent = segment ? key.slice(0, segment.index) : key;
28523 var keys = [];
28524 if (parent) {
28525 if (!options.plainObjects && has.call(Object.prototype, parent)) {
28526 if (!options.allowPrototypes) {
28527 return;
28528 }
28529 }
28530 keys.push(parent);
28531 }
28532 var i3 = 0;
28533 while (options.depth > 0 && (segment = child.exec(key)) !== null && i3 < options.depth) {
28534 i3 += 1;
28535 if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
28536 if (!options.allowPrototypes) {
28537 return;
28538 }
28539 }
28540 keys.push(segment[1]);
28541 }
28542 if (segment) {
28543 if (options.strictDepth === true) {
28544 throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
28545 }
28546 keys.push("[" + key.slice(segment.index) + "]");
28547 }
28548 return parseObject(keys, val, options, valuesParsed);
28549 };
28550 var normalizeParseOptions = function normalizeParseOptions2(opts) {
28551 if (!opts) {
28552 return defaults2;

Callers 1

Calls 3

parseObjectFunction · 0.85
sliceMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…