Socket
Socket
Sign inDemoInstall

compare-patterns

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    compare-patterns

module that compare two patterns


Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Install size
3.11 kB
Created
Weekly downloads
 

Readme

Source

Welcome to compare-patterns 👋

Version License: ISC

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!

Keywords

FAQs

Last updated on 04 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc