source: trip-planner-front/node_modules/wildcard/README.md

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.6 KB
Line 
1
2# wildcard
3
4Very simple wildcard matching, which is designed to provide the same
5functionality that is found in the
6[eve](https://github.com/adobe-webplatform/eve) eventing library.
7
8
9[![NPM](https://nodei.co/npm/wildcard.png)](https://nodei.co/npm/wildcard/)
10
11[![Build Status](https://api.travis-ci.org/DamonOehlman/wildcard.svg?branch=master)](https://travis-ci.org/DamonOehlman/wildcard) [![stable](https://img.shields.io/badge/stability-stable-green.svg)](https://github.com/dominictarr/stability#stable)
12
13## NOTE
14
15Work on this project is largely inactive, now so I'd recommend checking out
16the wonderful [`matcher`](https://github.com/sindresorhus/matcher) package
17as a solid alternative.
18
19## Usage
20
21It works with strings:
22
23```js
24var wildcard = require('wildcard');
25
26console.log(wildcard('foo.*', 'foo.bar'));
27// --> true
28
29console.log(wildcard('foo.*', 'foo'));
30// --> true
31
32```
33
34Arrays:
35
36```js
37var wildcard = require('wildcard');
38var testdata = [
39 'a.b.c',
40 'a.b',
41 'a',
42 'a.b.d'
43];
44
45console.log(wildcard('a.b.*', testdata));
46// --> ['a.b.c', 'a.b', 'a.b.d']
47
48```
49
50Objects (matching against keys):
51
52```js
53var wildcard = require('wildcard');
54var testdata = {
55 'a.b.c' : {},
56 'a.b' : {},
57 'a' : {},
58 'a.b.d' : {}
59};
60
61console.log(wildcard('a.*.c', testdata));
62// --> { 'a.b.c': {} }
63
64```
65
66## Alternative Implementations
67
68- <https://github.com/isaacs/node-glob>
69
70 Great for full file-based wildcard matching.
71
72- <https://github.com/sindresorhus/matcher>
73
74 A well cared for and loved JS wildcard matcher.
75
76## License(s)
77
78### MIT
79
80Copyright (c) 2017 Damon Oehlman <damon.oehlman@gmail.com>
81
82Permission is hereby granted, free of charge, to any person obtaining
83a copy of this software and associated documentation files (the
84'Software'), to deal in the Software without restriction, including
85without limitation the rights to use, copy, modify, merge, publish,
86distribute, sublicense, and/or sell copies of the Software, and to
87permit persons to whom the Software is furnished to do so, subject to
88the following conditions:
89
90The above copyright notice and this permission notice shall be
91included in all copies or substantial portions of the Software.
92
93THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
94EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
95MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
96IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
97CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
98TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
99SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Note: See TracBrowser for help on using the repository browser.