Skip to content
Myr

Removed toArray() util

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent ce2ec94 · Browse files · 3 files+4 added−23 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+4 added−23 removed

  • other:+4 added−23 removed

3 files+4 added−23 removed

modified:lib/router/index.js+2 added-3 removed
10 unmodified lines
1112var Route = require('./route')13 , Collection = require('./collection')14 , utils = require('../utils')15 , parse = require('url').parse16 , toArray = utils.toArray;15 , parse = require('url').parse;1617/**18 * Expose `Router` constructor.19 */
373 unmodified lines
393 */394395Router.prototype._route = function(method, path, callbacks){396 var app = this.app398 , callbacks = utils.flatten(toArray(arguments, 2));397 , callbacks = utils.flatten([].slice.call(arguments, 2));398399 // ensure path was given400 if (!path) throw new Error('app.' + method + '() requires a path');401
11 unmodified lines
modified:lib/application.js+2 added-3 removed
9 unmodified lines
10 */1112var connect = require('connect')13 , Router = require('./router')14 , toArray = require('./utils').toArray14 , methods = Router.methods.concat('del', 'all')15 , View = require('./view')16 , url = require('url')17 , utils = connect.utils
464 unmodified lines
482 */483484app.configure = function(env, fn){485 var envs = 'all'487 , args = toArray(arguments);486 , args = [].slice.call(arguments);487 fn = args.pop();488 if (args.length) envs = args;489 if ('all' == envs || ~envs.indexOf(this.settings.env)) fn.call(this);490 return this;
5 unmodified lines
496497methods.forEach(function(method){498 app[method] = function(path){499 if ('get' == method && 1 == arguments.length) return this.set(path); 501 var args = [method].concat(toArray(arguments));500 var args = [method].concat([].slice.call(arguments));501 if (!this._usedRouter) this.use(this.router);502 return this._router._route.apply(this._router, args);503 }504});
86 unmodified lines
modified:lib/utils.js-17 removed