Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

wildcard

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Issues
File Explorer

Advanced tools

wildcard

Wildcard matching tools

    2.0.0latest

Version published
Maintainers
1
Weekly downloads
6,914,081
decreased by-14.05%

Weekly downloads

Changelog

Source

2.0.0

The major issue addressed in this release is how wildcard would behave when it was provided a standalone wildcard (*) or a wildcard led pattern (*.foo). Prior to merging #11 sensible matches would fail and this has now been addressed.

For details on exactly what wildcard matches when, I'd recommend taking a look at the strings test file as that is fairly easy to read, plus if there is a case that you feel should be covered in the tests that isn't please feel free to raise a PR (it would be greatly appreciated).

Readme

Source

wildcard

Very simple wildcard matching, which is designed to provide the same functionality that is found in the eve eventing library.

NPM

Build Status stable

NOTE

Work on this project is largely inactive, now so I'd recommend checking out the wonderful matcher package as a solid alternative.

Usage

It works with strings:

var wildcard = require('wildcard'); console.log(wildcard('foo.*', 'foo.bar')); // --> true console.log(wildcard('foo.*', 'foo')); // --> true

Arrays:

var wildcard = require('wildcard'); var testdata = [ 'a.b.c', 'a.b', 'a', 'a.b.d' ]; console.log(wildcard('a.b.*', testdata)); // --> ['a.b.c', 'a.b', 'a.b.d']

Objects (matching against keys):

var wildcard = require('wildcard'); var testdata = { 'a.b.c' : {}, 'a.b' : {}, 'a' : {}, 'a.b.d' : {} }; console.log(wildcard('a.*.c', testdata)); // --> { 'a.b.c': {} }

Alternative Implementations

License(s)

MIT

Copyright (c) 2017 Damon Oehlman [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

FAQs

What is wildcard?

Wildcard matching tools

Is wildcard popular?

The npm package wildcard receives a total of 5,566,419 weekly downloads. As such, wildcard popularity was classified as popular.

Is wildcard well maintained?

We found that wildcard demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 24 Jun 2019

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc