This package has been deprecated

Author message:

INFO: 'regexpin' is no longer maintained.

regexpin

3.0.2 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i regexpin

Weekly Downloads

10

Version

3.0.2

License

ISC

Last publish

Collaborators

  • smockle