0.2.1 • Published 10 years ago
regexp-id v0.2.1
regexp-id
Returns an identifier based on a RegExp match against an object property's value.
npm install regexp-id --saveYou can also use Duo, Bower or download the files manually.
npm stats
API Example
var regexpId = require('regexp-id')
var company = {
name: 'Acme Corporation',
contact: '"Example Anvil" <example.anvil@example.com>'
}
var id = regexpId(/^"([^"]+)"/, 'contact')
id(company)
//=> '"Example Anvil"'API
regexpId(regexp, key)
arguments
regexp (RegExp)Regular expression.path (String)Dot or bracket-notation string path.
returns
(Function)Unary function accepting an object to evaluate.
Contributing
SEE: contributing.md