Skip to content
Myr

Added Collection#keys()

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

authored by visionmedia · committed by visionmedia · parent 9d02ed2 · Browse files · 2 files+26 added−0 removed
This commit

State

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

Diff stats

2 files+26 added−0 removed

  • tests:+12 added−0 removed
  • other:+14 added−0 removed

2 files+26 added−0 removed

modified:lib/express/collection.js+14 added
217 unmodified lines
218 grep: function(pattern) {219 return this.select(function(val){220 return pattern.exec(val)221 })222 },223 224 /**225 * Return keys as a collection.226 *227 * @return {Collection}228 * @api public229 */230 231 keys: function() {232 return $(this.reduce([], function(array, val, key){233 array.push(key)234 return array235 }))236 }237})238239/**
11 unmodified lines
modified:spec/spec.collection.js+12 added