safe-match
0.0.2 • Public • Published safe-match
Description
Prevent match API from the result of null.
Install
$ npm i safe-match
API
Usage
var safeMatch = require('safe-match').match
safeMatch('foo', /bar/)
var safeMatchInit = require('safe-match').init
var safeMatchReset = require('safe-match').reset
safeMatchInit()
'foo'.safeMatch(/bar/)
safeMatchReset()
'foo'.safeMatch(/bar/)
safeMatchInit({
name: 'match'
})
'foo'.match(/bar/)
safeMatchReset()
'foo'.match(/bar/)
safeMatchInit({
noConflict: true
})
'foo'.safeMatch(/bar/, true)
'foo'.safeMatch(/bar/)
safeMatchReset()
'foo'.match(/bar/, true)
Versions
Version | Downloads (Last 7 Days) | Tag |
---|
0.0.2 | 1 | latest |
Version History
Version | Downloads (Last 7 Days) | Published |
---|
0.0.2 | 1 | |
0.0.1 | 0 | |
Package Sidebar
Install
Weekly Downloads