regex-indexof

1.0.3 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    1
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i regex-indexof

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

2.01 kB

Total Files

6

Last publish

Collaborators

  • cond