3.0.2 • Published 7 years ago

regexpin v3.0.2

Weekly downloads
6
License
ISC
Repository
github
Last release
7 years ago

regexpIn

npm Build Status Build status codecov Known Vulnerabilities Greenkeeper badge

Like Immutable.JS’ Iterable#getIn, but with RegExp support.

Installation

Run npm install --save regexpin to add regexpIn to your project.

Usage

const Immutable = require('immutable')
const regexpIn = require('regexpin')
const map = Immutable.Map({ 'hello': { 'world': 3 } })

// regexpIn is curried, so you can partially-apply it
const messageGetter = regexpIn(['hello', /WO/i])
const message = messageGetter(map)
console.log(message) // Logs `3`

// You can also provide both arguments at once
const newMessage = regexpIn([/^(.*)lo$/, 'world'], map)
console.log(newMessage) // Also logs `3`

Testing

regexpIn includes several unit tests. After cloning the regexpIn repo locally, run npm install in the project folder to install dependencies, then npm test to execute the tests.

3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.0.0

7 years ago

1.0.3

7 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago