1.0.3 • Published 6 years ago

regex-indexof v1.0.3

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

Build Status

Allows regex usage in indexOf function

install

npm i regex-indexof --save

usage

const regexIndexOf = require('regex-indexof')

Array.prototype.indexOf = regexIndexOf

console.log([1,2,3,4,5].indexOf(3))

2

console.log(['/app', /\/app\/[0-9]{1,}/].indexOf("/app"))

0

console.log(['/app', /\/app\/[0-9]{1,}/].indexOf("/app/2"))

1

// or

console.log(regexIndexOf(['/app', /\/app\/[0-9]{1,}/], "/app/2"))

1
1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago