Walks a structure and returns arg

@method  walk
@param  {Mixed}  obj  Object or Array
@param  {String} arg  String describing the property to return
@return {Mixed}       arg
355251
function ( obj, arg ) {
		array.each( arg.replace( /\]$/, "" ).replace( /\]/g, "." ).replace( /\.\./g, "." ).split( /\.|\[/ ), function ( i ) {
			obj = obj[i];
		});

		return obj;
	}
161403
function walk(data, path, result, key) {
    var fn;

    switch (type(path)) {
      case 'string':
        fn = seekSingle;
        break;

      case 'array':
        fn = seekArray;
        break;

      case 'object':
        fn = seekObject;
        break;
    }

    if (fn) {
      fn(data, path, result, key);
    }
  }
769220
function(obj) {

    var __p = 'var index, iterable = ' +
    (obj.firstArg) +
    ', result = ' +
    (obj.init) +
    ';\nif (!iterable) return result;\n' +
    (obj.top) +
    ';';
     if (obj.array) {
    __p += '\nvar length = iterable.length; index = -1;\nif (' +
    (obj.array) +
    ') {  ';
     if (support.unindexedChars) {
    __p += '\n  if (isString(iterable)) {\n    iterable = iterable.split(\'\')\n  }  ';
     }
    __p += '\n  while (++index < length) {\n    ' +
    (obj.loop) +
    ';\n  }\n}\nelse {  ';
     } else if (support.nonEnumArgs) {
    __p += '\n  var length = iterable.length; index = -1;\n  if (length && isArguments(iterable)) {\n    while (++index < length) {\n      index += \'\';\n      ' +
    (obj.loop) +
    ';\n    }\n  } else {  ';
     }

     if (support.enumPrototypes) {
    __p += '\n  var skipProto = typeof iterable == \'function\';\n  ';
     }

     if (support.enumErrorProps) {
    __p += '\n  var skipErrorProps = iterable === errorProto || iterable instanceof Error;\n  ';
     }

        var conditions = [];    if (support.enumPrototypes) { conditions.push('!(skipProto && index == "prototype")'); }    if (support.enumErrorProps)  { conditions.push('!(skipErrorProps && (index == "message" || index == "name"))'); }

     if (obj.useHas && obj.useKeys) {
    __p += '\n  var ownIndex = -1,\n      ownProps = objectTypes[typeof iterable] && keys(iterable),\n      length = ownProps ? ownProps.length : 0;\n\n  while (++ownIndex < length) {\n    index = ownProps[ownIndex];\n';
        if (conditions.length) {
    __p += '    if (' +
    (conditions.join(' && ')) +
    ') {\n  ';
     }
    __p += 
    (obj.loop) +
    ';    ';
     if (conditions.length) {
    __p += '\n    }';
     }
    __p += '\n  }  ';
     } else {
    __p += '\n  for (index in iterable) {\n';
        if (obj.useHas) { conditions.push("hasOwnProperty.call(iterable, index)"); }    if (conditions.length) {
    __p += '    if (' +
    (conditions.join(' && ')) +
    ') {\n  ';
     }
    __p += 
    (obj.loop) +
    ';    ';
     if (conditions.length) {
    __p += '\n    }';
     }
    __p += '\n  }    ';
     if (support.nonEnumShadows) {
    __p += '\n\n  if (iterable !== objectProto) {\n    var ctor = iterable.constructor,\n        isProto = iterable === (ctor && ctor.prototype),\n        className = iterable === stringProto ? stringClass : iterable === errorProto ? errorClass : toString.call(iterable),\n        nonEnum = nonEnumProps[className];\n      ';
     for (k = 0; k < 7; k++) {
    __p += '\n    index = \'' +
    (obj.shadowedProps[k]) +
    '\';\n    if ((!(isProto && nonEnum[index]) && hasOwnProperty.call(iterable, index))';
            if (!obj.useHas) {
    __p += ' || (!nonEnum[index] && iterable[index] !== objectProto[index])';
     }
    __p += ') {\n      ' +
    (obj.loop) +
    ';\n    }      ';
     }
    __p += '\n  }    ';
     }

     }

     if (obj.array || support.nonEnumArgs) {
    __p += '\n}';
     }
    __p += 
    (obj.bottom) +
    ';\nreturn result';

    return __p
  }
1354939
function walk(obj, path, initializeMissing = false) {
  let newObj = obj;

  if (path) {
    const ar = path.split('.');
    while (ar.length) {
      const k = ar.shift();
      if (initializeMissing && obj[k] == null) {
        newObj[k] = {};
        newObj = newObj[k];
      } else if (k in newObj) {
        newObj = newObj[k];
      } else {
        throw new Error(`cannot find configuration param '${path}'`);
      }
    }
  }

  return newObj;
}
1293246
function ( obj, arg ) {
		arg = arg || 1;

		if ( arg < 1 ) {
			arg = 1;
		}

		return array.limit( obj, arg, obj.length );
	}
735759
function () {
	var len, attr, g, args;

	args = arguments;

	len = args.length;

	if (len === 0) {
		g = noop;
	}
	else if (len === 1) {
		attr = args[0];

		g = function (obj) {
			return obj[attr];
		};
	}
	else {
		g = function (obj) {
			var i, tuple;

			tuple = [];

			for (i = 0; i < len; ++i) {
				tuple.push(obj[args[i]]);
			}

			return tuple;
		};
	}



	return g;
}
865478
function getProp (obj, path, isArray) {
  var next;
  path = _.isString(path) ? path.split('.') : path;

  // We have more traversing to do
  if (path.length > 1) {
    next = path.shift();
    if (_.isArray(obj[next])) {
      isArray = true;
      var arr = _.compact(_.flatten(obj[next].map(function (el, i) {
        return getProp(el, _.clone(path), isArray);
      })));
      return arr.length ? arr : undefined;
    } else {
      if (!obj[next]) { return; }
      return getProp(obj[next], path, isArray);
    }

  // No more traversing. We can now target the final node with path[0]
  } else {
    next = path[0];
    // if we are at the end of the path and `obj` is an array
    if (_.isArray(obj)) {
      return _.pluck(obj, next);
    } else {
      if (!obj[next]) { return; }
      return isArray ? [obj[next]] : obj[next];
    }
  }
}
442312
function parse(args) {
  const cliArgs = [];
  const nodeArgs = [];

  for (const arg of args) {
    if (NODE_FLAGS.test(arg)) {
      nodeArgs.push(arg);
    } else {
      cliArgs.push(arg);
    }
  }

  return {
    cliArgs,
    nodeArgs
  };
}
471847
function ( arg ) {
		var result;

		if ( !arg ) {
			return;
		}

		arg = string.trim( arg );

		if ( arg.indexOf( "," ) === -1 ) {
			result = utility.dom( arg );
		}
		else {
			result = [];

			array.each( string.explode( arg ), function ( query ) {
				var obj = utility.dom( query );

				if ( obj instanceof Array ) {
					result = result.concat( obj );
				}
				else if ( obj ) {
					result.push( obj );
				}
			});
		}

		return result;
	}
1138794
function traverse (value, v) {
  var state = {}
  var visitor = v.visitor
  var seen = []

  /**
   * Recursively walk the value, dispatching visitor methods as values are encountered.
   *
   * @param {*} val Value
   * @param {Value|null} parent Parent value
   * @param {object} [opts] Additional options
   */
  function traverseValue (val, parent, opts) {
    var wrapper = Value(val, parent, opts)
    var enterFn = wrapper.type + 'Enter'
    var exitFn = wrapper.type + 'Exit'
    var keys

    if (wrapper.type === 'object' || wrapper.type === 'array') {
      if (seen.indexOf(wrapper.value) >= 0) {
        wrapper.isCircularRef = true
      }
      seen.push(wrapper.value)
    }

    if (wrapper.type === 'object') {
      keys = Object.keys(wrapper.value).sort()
      wrapper.length = keys.length
    }

    if (visitor[enterFn]) {
      visitor[enterFn](wrapper, state)
    } else if (visitor.otherEnter) {
      visitor.otherEnter(wrapper, state)
    }

    switch (wrapper.type) {
      case 'array':
        if (!wrapper.isCircularRef) {
          wrapper.value.forEach(function (child, i) {
            traverseValue(child, wrapper, { key: i })
          })
        }
        break

      case 'object':
        if (!wrapper.isCircularRef) {
          keys.forEach(function (key) {
            traverseValue(wrapper.value[key], wrapper, { key: key })
          })
        }
        break

      default:
        /* do nothing */
        break
    }

    if (visitor[exitFn]) {
      visitor[exitFn](wrapper, state)
    }

    if (wrapper.type === 'object' || wrapper.type === 'array') {
      seen.pop()
    }
  }

  if (v.pre) { v.pre.call(null, state) }
  traverseValue(value, null, null)
  if (v.post) { v.post.call(null, state) }
}
812297
function(args) {
  var argsMap = {};
  var mainPos = 1;

  while (args[mainPos].indexOf('--') > 0) {
    mainPos++;
  }
  argsMap.main = args[mainPos];

  for (var i = (mainPos + 1); i < args.length; i++) {
    var arg = args[i];
    var sep = arg.indexOf('=');
    var key = arg.slice(0, sep);
    var value = arg.slice(sep + 1);
    if (!isNaN(Number(value)) && (value.indexOf('.') < 0)) {
      value = Number(value);
    }
    argsMap[key] = value;
  }

  return argsMap;
}
1115608
function evalGet (obj, path) {
    var fn = 'return obj' + (path[0] !== '[' && path[0] !== '.' ? '.' : '') + path
    return new Function('obj', fn)(obj)
  }
483750
function nestedApply(obj, path, fun) {
	if (path.length === 0) {
		const _ret = fun(obj);
		return {
			ret: _ret,
			newObj: obj
		};
	}
	// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments
	let newObj = obj;
	const last = path.pop();
	for (const elem of path) {
		if (!newObj[elem])
			newObj[elem] = {};
		newObj = newObj[elem];
	}
	const ret = fun(newObj[last]);
	return {
		ret,
		newObj
	};
}
506057
function ( obj, arg ) {
		var result = -1;

		array.each( obj, function ( i, idx ) {
			if ( i === arg ) {
				result = idx;
			}
		});

		return result;
	}
243319
function parse(arg)
{
  try{
    var url = urllib.parse(arg, true);
  }catch(E){
    return false;
  }

  // paths is always an array
  if(!url.query.paths) url.query.paths = [];
  if(!Array.isArray(url.query.paths)) url.query.paths = [url.query.paths];
  
  // parse any paths
  url.paths = [];
  url.query.paths.forEach(function(epath){
    try{
      var path = JSON.parse(hashname.base32.decode(epath));
      if(typeof path == 'object' && typeof path.type == 'string') url.paths.push(path);
    }catch(E){};
  });

  // parse any csid keys
  url.keys = {};
  Object.keys(url.query).forEach(function(id){
    if(id.length != 4 || id.substr(0,2) != 'cs') return;
    url.keys[id.substr(2)] = url.query[id];
  });
  
  // parse any fragment
  if(url.hash) url.fragment = hashname.base32.decode(url.hash.substr(1));
  
  // add formatting wrapper
  url.encode = function()
  {
    // delete these to force lib to make new
    delete url.search;
    delete url.href;
    if(url.query.paths.length == 0) delete url.query.paths; // dumb node bug
    return urllib.format(url);
  }
  
  return url;
}
140674
function convertToObject(args) {
	let result = {};

	args.forEach((arg, i) => {
		if (Array.isArray(arg)) {
			result[arg[0]] = arg[1];
		} else {
			if (i % 2 === 0) {
				result[arg] = undefined;
			} else {
				result[args[i - 1]] = arg;
			}
		}
	});

	return result;
}
955187
function walk_obj(next, next_child) {
  var tag_type, i, prop;
  var name = type(next);

  if ('Undefined' == name) {
    return;
  } else if (Array.isArray(next)) {
    next_child = next_child.ele('array');
    for (i = 0; i < next.length; i++) {
      walk_obj(next[i], next_child);
    }

  } else if (Buffer.isBuffer(next)) {
    next_child.ele('data').raw(next.toString('base64'));

  } else if ('Object' == name) {
    next_child = next_child.ele('dict');
    for (prop in next) {
      if (next.hasOwnProperty(prop)) {
        next_child.ele('key').txt(prop);
        walk_obj(next[prop], next_child);
      }
    }

  } else if ('Number' == name) {
    // detect if this is an integer or real
    // TODO: add an ability to force one way or another via a "cast"
    tag_type = (next % 1 === 0) ? 'integer' : 'real';
    next_child.ele(tag_type).txt(next.toString());

  } else if ('Date' == name) {
    next_child.ele('date').txt(ISODateString(new Date(next)));

  } else if ('Boolean' == name) {
    next_child.ele(next ? 'true' : 'false');

  } else if ('String' == name) {
    next_child.ele('string').txt(next);

  } else if ('ArrayBuffer' == name) {
    next_child.ele('data').raw(base64.fromByteArray(next));

  } else if (next && next.buffer && 'ArrayBuffer' == type(next.buffer)) {
    // a typed array
    next_child.ele('data').raw(base64.fromByteArray(new Uint8Array(next.buffer), next_child));

  }
}