Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

regexp-id

wilmoore12MIT0.2.1

Returns an identifier based on a RegExp match against an object property's value.

expression, id, identify, identity, regex, regexp, regexp-id, regular, regular-expression, regularexpression

readme

regexp-id

Returns an identifier based on a RegExp match against an object property's value.

Build Status Code Climate js-standard-style

npm install regexp-id --save

You can also use Duo, Bower or download the files manually.

npm stats

npm NPM downloads David

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

Licenses

GitHub license

changelog

Change Log

All notable changes to this project will be documented in this file (keepachangelog.com).

0.2.1 - 2016-01-14

Added

  • Initial Version.