source: imaps-frontend/node_modules/wildcard/README.md

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago

F4 Finalna Verzija

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