1.0.1 ā€¢ Published 3 years ago

compare-patterns v1.0.1

Weekly downloads
5
License
ISC
Repository
github
Last release
3 years ago

module that compare two patterns

šŸ  Homepage

Install

npm install compare-patterns

Run tests

npm install -D
npm run test

Usage

const comparePatterns = require('compare-patterns');
comparePatterns('a.**.b', 'a.1.2.3.4.5.6.b'); // true
comparePatterns('a.*.b', 'a.1.b'); // true
comparePatterns('a.?.b', 'a.x.b'); // true

Description

  • pattern split by '.'
  • * means everything (it equals /./ in regex)
  • * means everything except '.' (dot) (it equals /^.*/ in regex)
  • ? means any char (it equals /./ in regex)

Author

šŸ‘¤ 0x0a0d

šŸ¤ Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ā­ļø if this project helped you!