Creates and returns an array of routes from the given object which
may be a JSX route, a plain object route, or an array of either.
348647
function createRoutes(routes) {
  if (isReactChildren(routes)) {
    routes = createRoutesFromReactChildren(routes);
  } else if (routes && !Array.isArray(routes)) {
    routes = [routes];
  }

  return routes;
}
233783
function (object) {
        ACCEPTABLE_METHODS.forEach(function (method) {
            /**
             * Bind the provided route with a specific method to the callback provided.
             * Since you cannot specify a route more than once, it is required to use bind to provide multiple methods.
             *
             * @param {String} routeName The name of the route. Should be a JavaScript identifier. Optional.
             * @param {String} route The URL for the route.
             * @param {Function} callback The callback to be called when the route is accessed.
             *
             * @throws Error the routeName is already specified
             * @throws Error the route is already specified
             * @throws Error the route does not start with "/"
             * @throws Error an unknown route converter was specified
             *
             * @api public
             * 
             * @example routes.get("/", function(request, response) {
             *     response.end("GET /");
             * });
             * @example routes.post("item", "/{name}", function(request, response, params) {
             *     response.end("GET /" + params.name);
             * });
             */
            object[method] = function (routeName, route, callback) {
                if (arguments.length === 2) {
                    callback = route;
                    route = routeName;
                    routeName = null;
                }
                var descriptor = {};
                descriptor[method] = callback;
                if (arguments.length === 2) {
                    return this.bind(route, descriptor);
                } else {
                    return this.bind(routeName, route, descriptor);
                }
            };
        });
        object.del = object.delete;
    }
284751
public function routeByObject($object) : array
    {
        Assert::isObject($object, "Passed non object value to Commmand Bus: " . TypeDescriptor::createFromVariable($object)->toString() . ". Did you wanted to use convertAndSend?");

        $className = get_class($object);
        if (!array_key_exists($className, $this->classNameToChannelNameMapping)) {
            throw ConfigurationException::create("Can't send command to {$className}. No Command Handler defined for it. Have you forgot to add @CommandHandler to method or @MessageEndpoint to class?");
        }

        return $this->classNameToChannelNameMapping[$className];
    }
1351049
public static ObjectNode from(Route route, Json json) {
        return json.newObject().put("url", route.getUrl())
                .put("controller", route.getControllerClass().getName())
                .put("method", route.getControllerMethod().getName())
                .put("http_method", route.getHttpMethod().toString());
    }
1341227
function serialize(obj, opts, prefix) {
  var str = []
    , useArraySyntax = false

  // if there's a prefix, and this object is an array, use array syntax
  // i.e., `prefix[]=foo&prefix[]=bar` instead of `prefix[0]=foo&prefix[1]=bar`
  if (Array.isArray(obj) && prefix) {
    useArraySyntax = true
  }

  Object.keys(obj).forEach(function (prop) {
    var key, query, val = obj[prop]

    key = prefix ?
      prefix + '[' + (useArraySyntax ? '' : prop) + ']' :
      prop

    if (val === null) {
      if (opts.removeNull) {
        return
      }
      query = opts.encodeComponents ? encodeURIComponent(key) : key
    } else if (typeof val === 'object') {
      query = serialize(val, opts, key)
    } else {
      query = opts.encodeComponents ?
        encodeURIComponent(key) + '=' + encodeURIComponent(val) :
        key + '=' + val;
    }
    str.push(query)
  })

  return str.join('&')
}
1005589
function(newRoutes)
    {
        for(var key in newRoutes)
        {
            if(routes.hasOwnProperty(key))
            {
                if(typeof routes[key] == 'Array')
                {
                    routes[key].push(newRoutes[key]);
                }
                else
                {
                    routes[key] = [routes[key],newRoutes[key]];
                }
            }
            else
            {
                routes[key] = newRoutes[key];
            }
        }
    }
1269247
function parseMappings(obj) {
        var mapping = {};

        // throw a helpful error when mapTwoWayState is mixed up with mapState
        if (Array.isArray(obj)) {
            error('Invalid arguments for mapTwoWayState. State mapping must be an object in { \'path.to.state\': \'mutationName\' } format.');
        }

        Object.keys(obj).forEach(function (key) {
            var value = obj[key];
            var vmKey = key.slice(key.lastIndexOf('.') + 1);

            if (typeof value === 'string') {
                mapping[vmKey] = { key: key, mutation: value };
            } else {
                mapping[vmKey] = { key: value.key, mutation: value.mutation };
            }
        });

        return mapping;
    }
750191
function Route(ctx, path, handler) {
  if (!(this instanceof Route))
    return new Route(ctx, path, handler);

  this.ctx = null;
  this.path = null;
  this.handler = null;

  this.regex = /^/;
  this.map = [];
  this.compiled = false;

  if (ctx) {
    assert(typeof ctx === 'object');
    this.ctx = ctx;
  }

  if (path) {
    if (path instanceof RegExp) {
      this.regex = path;
    } else {
      assert(typeof path === 'string');
      assert(path.length > 0);
      this.path = path;
    }
  }

  assert(handler);
  assert(typeof handler === 'function' || typeof handler === 'object');

  this.handler = handler;
}
1009854
function parseObj(opts) {
    var obj = new Obj();

    Object.keys(opts).forEach(function (key) {
        obj[key] = opts[key];
    });

    return obj;
}
313665
function Route(props) {
  props = props ? merge({}, props) : {};

  var path = props.path;

  if (typeof path === 'string') {
    path = path.replace(slashes, '');
  }

  delete props.path;

  var view = props.view;
  delete props.view;

  var viewPromise = props.viewPromise;
  delete props.viewPromise;

  var name = props.name;
  delete props.name;

  var __scope = props.__scope;
  delete props.__scope;

  var args = Array.prototype.slice.call(arguments, 1);

  var children = [];

  // so we support passing routes as arguments and arrays
  for (var i = 0, len = args.length; i < len; i++) {
    if (Array.isArray(args[i])) {
      children = children.concat(args[i]);
    } else {
      children.push(args[i]);
    }
  }

  var route = {path, name, view, viewPromise, props, children, __scope};
  buildNameIndex(route);
  return route;
}
11023
@SuppressWarnings("unchecked")
    public Iterable<?> toIterable(Object obj) {
        if (isArray(obj))
            return ((Iterable) obj);
        else
            throw new JsonPathException("Cannot iterate over " + obj!=null?obj.getClass().getName():"null");
    }
880105
function toArray(path: NodePath): Array<string> {
  const parts = [path];
  let result = [];

  while (parts.length > 0) {
    path = parts.shift();
    const node = path.node;
    if (t.CallExpression.check(node)) {
      parts.push(path.get('callee'));
      continue;
    } else if (t.MemberExpression.check(node)) {
      parts.push(path.get('object'));
      if (node.computed) {
        const resolvedPath = resolveToValue(path.get('property'));
        if (resolvedPath !== undefined) {
          result = result.concat(toArray(resolvedPath));
        } else {
          result.push('<computed>');
        }
      } else {
        result.push(node.property.name);
      }
      continue;
    } else if (t.Identifier.check(node)) {
      result.push(node.name);
      continue;
    } else if (t.Literal.check(node)) {
      result.push(node.raw);
      continue;
    } else if (t.ThisExpression.check(node)) {
      result.push('this');
      continue;
    } else if (t.ObjectExpression.check(node)) {
      const properties = path.get('properties').map(function(property) {
        return (
          toString(property.get('key')) + ': ' + toString(property.get('value'))
        );
      });
      result.push('{' + properties.join(', ') + '}');
      continue;
    } else if (t.ArrayExpression.check(node)) {
      result.push(
        '[' +
          path
            .get('elements')
            .map(toString)
            .join(', ') +
          ']',
      );
      continue;
    }
  }

  return result.reverse();
}
998425
def _build_jss_object_list(self, response, obj_class):
        """"""
        response_objects = [item for item in response
                            if item is not None and
                            item.tag != "size"]
        objects = [
            JSSListData(obj_class, {i.tag: i.text for i in response_object},
                        self) for response_object in response_objects]

        return JSSObjectList(self, obj_class, objects)
544527
function objectMap (obj, iterate, context) {
  var result = {}
  if (obj) {
    if (iterate) {
      context = context || this
      if (!isFunction(iterate)) {
        iterate = property(iterate)
      }
      each(obj, function (val, index) {
        result[index] = iterate.call(context, val, index, obj)
      })
    } else {
      return obj
    }
  }
  return result
}
482391
function routeAndCorrectedPathIndexes(routes, pathIndex) {
        for(var n=0; n<routes.length; n++) {
            var pathIndexes = routes[n].pathIndexes
            if(pathIndexes.start <= pathIndex && pathIndex <= pathIndexes.end || routes[n].route.isDefault) {
                return {routeIndex: n, pathIndex: pathIndexes.start}
            }
        }
        // else
        return {routeIndex: routes.length, pathIndex: pathIndex}
    }
160641
function(obj) {
			var result = {};
			var keys = this.toArray(arguments, 1);
			Object.keys(obj).forEach(function(key) {
				if (~keys.indexOf(key)) {
					result[key] = obj[key];
				}
			});
			return result;
		}
304604
function getRoutes(req, res) {
        var index = {
            name: about.name,
            version: about.version,
            description: about.description,
            routes: app.routes
        };
        return res.json(index);
    }