namespace-matcher
v0.0.1
Published
Namespace string matcher.
Downloads
4
Maintainers
Readme
namespace-matcher
namespace-matcher is a simply module for namespace match.
Install & Usage
npm i --save namespace-matcher
Then import and use it.
import namespace from 'namespace-matcher'; // ES6
namespace('a.b.c').match('a.b.*') // true
namespace('a.b.*').match('a.b.c') // true
namespace('a.b').match('a.b.*') // false
// also you can set up your own option
namespace('a-*', {
sep: '-' // separator
}).match('a-b') // true
namespace('a.$', {
wil: '$' // wildcard character
}).match('a.b') // true
License
ISC@hustcc.