How to use methods.indexOf:
137 138 139 140 141 142 143 144
*/ function supports (method) { return method && typeof method === 'string' && methods.indexOf(method.toLowerCase()) !== -1 }
How to use methods.forEach:
402 403 404 405 406 407 408 409 410 411
.get('/') .expect('ETag', 'W/"c-IgR/L5SF7CJQff4wxKGF/vfPuZ0"') .expect(200, done); }); methods.forEach(function (method) { if (method === 'connect') return; it('should send ETag in response to ' + method.toUpperCase() + ' request', function (done) { var app = express();
How to use methods.push:
GitHub: mansimodiTrootech/repoA
76 77 78 79 80 81 82 83 84 85 86 87
Route.prototype._options = function _options() { var methods = Object.keys(this.methods); // append automatic head if (this.methods.get && !this.methods.head) { methods.push('head'); } for (var i = 0; i < methods.length; i++) { // make upper case