angular-slickgrid 4.1.4 → 4.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +182 -180
- package/app/modules/angular-slickgrid/components/angular-slickgrid.component.d.ts +2 -2
- package/app/modules/angular-slickgrid/extensions/slickRowDetailView.d.ts +0 -2
- package/esm2020/app/modules/angular-slickgrid/components/angular-slickgrid.component.mjs +15 -12
- package/esm2020/app/modules/angular-slickgrid/extensions/slickRowDetailView.mjs +1 -3
- package/esm2020/app/modules/angular-slickgrid/modules/angular-slickgrid.module.mjs +7 -10
- package/esm2020/app/modules/angular-slickgrid/services/angularUtil.service.mjs +3 -3
- package/esm2020/app/modules/angular-slickgrid/services/bsDropdown.service.mjs +3 -3
- package/esm2020/app/modules/angular-slickgrid/services/container.service.mjs +3 -3
- package/esm2020/app/modules/angular-slickgrid/services/translater.service.mjs +3 -3
- package/fesm2015/angular-slickgrid.mjs +32 -34
- package/fesm2015/angular-slickgrid.mjs.map +1 -1
- package/fesm2020/angular-slickgrid.mjs +32 -34
- package/fesm2020/angular-slickgrid.mjs.map +1 -1
- package/{angular-slickgrid.d.ts → index.d.ts} +0 -0
- package/package.json +14 -15
- package/test/cypress/node_modules/@cypress/request/README.md +1038 -0
- package/test/cypress/node_modules/@cypress/xvfb/README.md +48 -0
- package/test/cypress/node_modules/@cypress/xvfb/node_modules/debug/README.md +437 -0
- package/test/cypress/node_modules/@types/node/README.md +16 -0
- package/test/cypress/node_modules/@types/sinonjs__fake-timers/README.md +16 -0
- package/test/cypress/node_modules/@types/sizzle/README.md +16 -0
- package/test/cypress/node_modules/@types/yauzl/README.md +16 -0
- package/test/cypress/node_modules/@types/yauzl/node_modules/@types/node/README.md +16 -0
- package/test/cypress/node_modules/aggregate-error/README.md +61 -0
- package/test/cypress/node_modules/ansi-colors/README.md +315 -0
- package/test/cypress/node_modules/ansi-escapes/README.md +245 -0
- package/test/cypress/node_modules/ansi-regex/README.md +78 -0
- package/test/cypress/node_modules/ansi-styles/README.md +152 -0
- package/test/cypress/node_modules/arch/README.md +71 -0
- package/test/cypress/node_modules/asn1/README.md +50 -0
- package/test/cypress/node_modules/assert-plus/README.md +162 -0
- package/test/cypress/node_modules/astral-regex/README.md +46 -0
- package/test/cypress/node_modules/async/README.md +60 -0
- package/test/cypress/node_modules/asynckit/README.md +233 -0
- package/test/cypress/node_modules/at-least-node/README.md +25 -0
- package/test/cypress/node_modules/aws-sign2/README.md +4 -0
- package/test/cypress/node_modules/aws4/README.md +183 -0
- package/test/cypress/node_modules/balanced-match/README.md +91 -0
- package/test/cypress/node_modules/base64-js/README.md +34 -0
- package/test/cypress/node_modules/bcrypt-pbkdf/README.md +45 -0
- package/test/cypress/node_modules/blob-util/README.md +623 -0
- package/test/cypress/node_modules/bluebird/README.md +57 -0
- package/test/cypress/node_modules/brace-expansion/README.md +129 -0
- package/test/cypress/node_modules/buffer/README.md +410 -0
- package/test/cypress/node_modules/buffer-crc32/README.md +47 -0
- package/test/cypress/node_modules/cachedir/README.md +27 -0
- package/test/cypress/node_modules/caseless/README.md +45 -0
- package/test/cypress/node_modules/chalk/README.md +293 -0
- package/test/cypress/node_modules/chalk/node_modules/supports-color/README.md +76 -0
- package/test/cypress/node_modules/check-more-types/README.md +952 -0
- package/test/cypress/node_modules/ci-info/README.md +114 -0
- package/test/cypress/node_modules/clean-stack/README.md +76 -0
- package/test/cypress/node_modules/cli-cursor/README.md +55 -0
- package/test/cypress/node_modules/cli-table3/README.md +218 -0
- package/test/cypress/node_modules/cli-truncate/README.md +139 -0
- package/test/cypress/node_modules/color-convert/README.md +68 -0
- package/test/cypress/node_modules/color-name/README.md +11 -0
- package/test/cypress/node_modules/colorette/README.md +102 -0
- package/test/cypress/node_modules/colors/README.md +221 -0
- package/test/cypress/node_modules/combined-stream/README.md +138 -0
- package/test/cypress/node_modules/commander/README.md +737 -0
- package/test/cypress/node_modules/common-tags/README.md +687 -0
- package/test/cypress/node_modules/core-util-is/README.md +3 -0
- package/test/cypress/node_modules/cross-spawn/README.md +96 -0
- package/test/cypress/node_modules/cypress/README.md +25 -0
- package/test/cypress/node_modules/cypress/mount-utils/README.md +14 -0
- package/test/cypress/node_modules/cypress/react/README.md +414 -0
- package/test/cypress/node_modules/cypress/vue/README.md +678 -0
- package/test/cypress/node_modules/cypress/vue2/README.md +693 -0
- package/test/cypress/node_modules/dashdash/README.md +574 -0
- package/test/cypress/node_modules/dayjs/README.md +128 -0
- package/test/cypress/node_modules/debug/README.md +455 -0
- package/test/cypress/node_modules/delayed-stream/README.md +141 -0
- package/test/cypress/node_modules/ecc-jsbn/README.md +8 -0
- package/test/cypress/node_modules/emoji-regex/README.md +73 -0
- package/test/cypress/node_modules/end-of-stream/README.md +54 -0
- package/test/cypress/node_modules/enquirer/README.md +1752 -0
- package/test/cypress/node_modules/escape-string-regexp/README.md +27 -0
- package/test/cypress/node_modules/eventemitter2/README.md +809 -0
- package/test/cypress/node_modules/execa/README.md +656 -0
- package/test/cypress/node_modules/executable/README.md +64 -0
- package/test/cypress/node_modules/extend/README.md +81 -0
- package/test/cypress/node_modules/extract-zip/README.md +57 -0
- package/test/cypress/node_modules/extract-zip/node_modules/debug/README.md +455 -0
- package/test/cypress/node_modules/extsprintf/README.md +46 -0
- package/test/cypress/node_modules/fd-slicer/README.md +199 -0
- package/test/cypress/node_modules/figures/README.md +139 -0
- package/test/cypress/node_modules/forever-agent/README.md +4 -0
- package/test/cypress/node_modules/form-data/README.md +234 -0
- package/test/cypress/node_modules/fs-extra/README.md +264 -0
- package/test/cypress/node_modules/fs.realpath/README.md +33 -0
- package/test/cypress/node_modules/get-stream/README.md +124 -0
- package/test/cypress/node_modules/getos/README.md +79 -0
- package/test/cypress/node_modules/getpass/README.md +32 -0
- package/test/cypress/node_modules/glob/README.md +375 -0
- package/test/cypress/node_modules/global-dirs/README.md +72 -0
- package/test/cypress/node_modules/graceful-fs/README.md +133 -0
- package/test/cypress/node_modules/has-flag/README.md +89 -0
- package/test/cypress/node_modules/http-signature/README.md +80 -0
- package/test/cypress/node_modules/human-signals/README.md +155 -0
- package/test/cypress/node_modules/ieee754/README.md +51 -0
- package/test/cypress/node_modules/indent-string/README.md +70 -0
- package/test/cypress/node_modules/inflight/README.md +37 -0
- package/test/cypress/node_modules/inherits/README.md +42 -0
- package/test/cypress/node_modules/ini/README.md +102 -0
- package/test/cypress/node_modules/is-ci/README.md +50 -0
- package/test/cypress/node_modules/is-fullwidth-code-point/README.md +39 -0
- package/test/cypress/node_modules/is-installed-globally/README.md +31 -0
- package/test/cypress/node_modules/is-path-inside/README.md +63 -0
- package/test/cypress/node_modules/is-stream/README.md +57 -0
- package/test/cypress/node_modules/is-typedarray/README.md +16 -0
- package/test/cypress/node_modules/isexe/README.md +51 -0
- package/test/cypress/node_modules/isstream/README.md +66 -0
- package/test/cypress/node_modules/jsbn/README.md +175 -0
- package/test/cypress/node_modules/json-schema/README.md +3 -0
- package/test/cypress/node_modules/json-stringify-safe/README.md +52 -0
- package/test/cypress/node_modules/jsonfile/README.md +205 -0
- package/test/cypress/node_modules/jsonfile/node_modules/universalify/README.md +76 -0
- package/test/cypress/node_modules/jsprim/README.md +287 -0
- package/test/cypress/node_modules/lazy-ass/README.md +269 -0
- package/test/cypress/node_modules/listr2/README.md +17 -0
- package/test/cypress/node_modules/lodash/README.md +39 -0
- package/test/cypress/node_modules/lodash.once/README.md +18 -0
- package/test/cypress/node_modules/log-symbols/README.md +51 -0
- package/test/cypress/node_modules/log-update/README.md +97 -0
- package/test/cypress/node_modules/log-update/node_modules/slice-ansi/README.md +66 -0
- package/test/cypress/node_modules/log-update/node_modules/wrap-ansi/README.md +97 -0
- package/test/cypress/node_modules/lru-cache/README.md +166 -0
- package/test/cypress/node_modules/merge-stream/README.md +78 -0
- package/test/cypress/node_modules/mime-db/README.md +102 -0
- package/test/cypress/node_modules/mime-types/README.md +123 -0
- package/test/cypress/node_modules/mimic-fn/README.md +69 -0
- package/test/cypress/node_modules/minimatch/README.md +209 -0
- package/test/cypress/node_modules/ms/README.md +60 -0
- package/test/cypress/node_modules/npm-run-path/README.md +115 -0
- package/test/cypress/node_modules/once/README.md +79 -0
- package/test/cypress/node_modules/onetime/README.md +94 -0
- package/test/cypress/node_modules/ospath/README.md +53 -0
- package/test/cypress/node_modules/p-map/README.md +89 -0
- package/test/cypress/node_modules/path-is-absolute/README.md +59 -0
- package/test/cypress/node_modules/path-key/README.md +61 -0
- package/test/cypress/node_modules/pend/README.md +41 -0
- package/test/cypress/node_modules/performance-now/README.md +30 -0
- package/test/cypress/node_modules/pify/README.md +119 -0
- package/test/cypress/node_modules/pretty-bytes/README.md +131 -0
- package/test/cypress/node_modules/proxy-from-env/README.md +131 -0
- package/test/cypress/node_modules/psl/README.md +215 -0
- package/test/cypress/node_modules/pump/README.md +65 -0
- package/test/cypress/node_modules/punycode/README.md +122 -0
- package/test/cypress/node_modules/qs/README.md +475 -0
- package/test/cypress/node_modules/request-progress/README.md +78 -0
- package/test/cypress/node_modules/restore-cursor/README.md +26 -0
- package/test/cypress/node_modules/rimraf/README.md +101 -0
- package/test/cypress/node_modules/rxjs/README.md +147 -0
- package/test/cypress/node_modules/rxjs/_esm2015/README.md +147 -0
- package/test/cypress/node_modules/rxjs/_esm5/README.md +147 -0
- package/test/cypress/node_modules/rxjs/src/README.md +147 -0
- package/test/cypress/node_modules/safe-buffer/README.md +584 -0
- package/test/cypress/node_modules/safer-buffer/README.md +156 -0
- package/test/cypress/node_modules/semver/README.md +566 -0
- package/test/cypress/node_modules/shebang-command/README.md +34 -0
- package/test/cypress/node_modules/shebang-regex/README.md +33 -0
- package/test/cypress/node_modules/signal-exit/README.md +39 -0
- package/test/cypress/node_modules/slice-ansi/README.md +72 -0
- package/test/cypress/node_modules/sshpk/README.md +804 -0
- package/test/cypress/node_modules/string-width/README.md +50 -0
- package/test/cypress/node_modules/strip-ansi/README.md +46 -0
- package/test/cypress/node_modules/strip-final-newline/README.md +30 -0
- package/test/cypress/node_modules/supports-color/README.md +77 -0
- package/test/cypress/node_modules/throttleit/README.md +32 -0
- package/test/cypress/node_modules/tmp/README.md +365 -0
- package/test/cypress/node_modules/tough-cookie/README.md +527 -0
- package/test/cypress/node_modules/tslib/README.md +142 -0
- package/test/cypress/node_modules/tunnel-agent/README.md +4 -0
- package/test/cypress/node_modules/tweetnacl/README.md +459 -0
- package/test/cypress/node_modules/type-fest/README.md +760 -0
- package/test/cypress/node_modules/universalify/README.md +76 -0
- package/test/cypress/node_modules/untildify/README.md +30 -0
- package/test/cypress/node_modules/uuid/README.md +505 -0
- package/test/cypress/node_modules/verror/README.md +528 -0
- package/test/cypress/node_modules/verror/node_modules/extsprintf/README.md +46 -0
- package/test/cypress/node_modules/which/README.md +54 -0
- package/test/cypress/node_modules/wrap-ansi/README.md +91 -0
- package/test/cypress/node_modules/wrappy/README.md +36 -0
- package/test/cypress/node_modules/yallist/README.md +204 -0
- package/test/cypress/node_modules/yauzl/README.md +658 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# mime-types
|
|
2
|
+
|
|
3
|
+
[![NPM Version][npm-version-image]][npm-url]
|
|
4
|
+
[![NPM Downloads][npm-downloads-image]][npm-url]
|
|
5
|
+
[![Node.js Version][node-version-image]][node-version-url]
|
|
6
|
+
[![Build Status][travis-image]][travis-url]
|
|
7
|
+
[![Test Coverage][coveralls-image]][coveralls-url]
|
|
8
|
+
|
|
9
|
+
The ultimate javascript content-type utility.
|
|
10
|
+
|
|
11
|
+
Similar to [the `mime@1.x` module](https://www.npmjs.com/package/mime), except:
|
|
12
|
+
|
|
13
|
+
- __No fallbacks.__ Instead of naively returning the first available type,
|
|
14
|
+
`mime-types` simply returns `false`, so do
|
|
15
|
+
`var type = mime.lookup('unrecognized') || 'application/octet-stream'`.
|
|
16
|
+
- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.
|
|
17
|
+
- No `.define()` functionality
|
|
18
|
+
- Bug fixes for `.lookup(path)`
|
|
19
|
+
|
|
20
|
+
Otherwise, the API is compatible with `mime` 1.x.
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
This is a [Node.js](https://nodejs.org/en/) module available through the
|
|
25
|
+
[npm registry](https://www.npmjs.com/). Installation is done using the
|
|
26
|
+
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
$ npm install mime-types
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Adding Types
|
|
33
|
+
|
|
34
|
+
All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db),
|
|
35
|
+
so open a PR there if you'd like to add mime types.
|
|
36
|
+
|
|
37
|
+
## API
|
|
38
|
+
|
|
39
|
+
<!-- eslint-disable no-unused-vars -->
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
var mime = require('mime-types')
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
All functions return `false` if input is invalid or not found.
|
|
46
|
+
|
|
47
|
+
### mime.lookup(path)
|
|
48
|
+
|
|
49
|
+
Lookup the content-type associated with a file.
|
|
50
|
+
|
|
51
|
+
<!-- eslint-disable no-undef -->
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
mime.lookup('json') // 'application/json'
|
|
55
|
+
mime.lookup('.md') // 'text/markdown'
|
|
56
|
+
mime.lookup('file.html') // 'text/html'
|
|
57
|
+
mime.lookup('folder/file.js') // 'application/javascript'
|
|
58
|
+
mime.lookup('folder/.htaccess') // false
|
|
59
|
+
|
|
60
|
+
mime.lookup('cats') // false
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### mime.contentType(type)
|
|
64
|
+
|
|
65
|
+
Create a full content-type header given a content-type or extension.
|
|
66
|
+
When given an extension, `mime.lookup` is used to get the matching
|
|
67
|
+
content-type, otherwise the given content-type is used. Then if the
|
|
68
|
+
content-type does not already have a `charset` parameter, `mime.charset`
|
|
69
|
+
is used to get the default charset and add to the returned content-type.
|
|
70
|
+
|
|
71
|
+
<!-- eslint-disable no-undef -->
|
|
72
|
+
|
|
73
|
+
```js
|
|
74
|
+
mime.contentType('markdown') // 'text/x-markdown; charset=utf-8'
|
|
75
|
+
mime.contentType('file.json') // 'application/json; charset=utf-8'
|
|
76
|
+
mime.contentType('text/html') // 'text/html; charset=utf-8'
|
|
77
|
+
mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1'
|
|
78
|
+
|
|
79
|
+
// from a full path
|
|
80
|
+
mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8'
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### mime.extension(type)
|
|
84
|
+
|
|
85
|
+
Get the default extension for a content-type.
|
|
86
|
+
|
|
87
|
+
<!-- eslint-disable no-undef -->
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
mime.extension('application/octet-stream') // 'bin'
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### mime.charset(type)
|
|
94
|
+
|
|
95
|
+
Lookup the implied default charset of a content-type.
|
|
96
|
+
|
|
97
|
+
<!-- eslint-disable no-undef -->
|
|
98
|
+
|
|
99
|
+
```js
|
|
100
|
+
mime.charset('text/markdown') // 'UTF-8'
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### var type = mime.types[extension]
|
|
104
|
+
|
|
105
|
+
A map of content-types by extension.
|
|
106
|
+
|
|
107
|
+
### [extensions...] = mime.extensions[type]
|
|
108
|
+
|
|
109
|
+
A map of extensions by content-type.
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
[MIT](LICENSE)
|
|
114
|
+
|
|
115
|
+
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master
|
|
116
|
+
[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master
|
|
117
|
+
[node-version-image]: https://badgen.net/npm/node/mime-types
|
|
118
|
+
[node-version-url]: https://nodejs.org/en/download
|
|
119
|
+
[npm-downloads-image]: https://badgen.net/npm/dm/mime-types
|
|
120
|
+
[npm-url]: https://npmjs.org/package/mime-types
|
|
121
|
+
[npm-version-image]: https://badgen.net/npm/v/mime-types
|
|
122
|
+
[travis-image]: https://badgen.net/travis/jshttp/mime-types/master
|
|
123
|
+
[travis-url]: https://travis-ci.org/jshttp/mime-types
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# mimic-fn [](https://travis-ci.org/sindresorhus/mimic-fn)
|
|
2
|
+
|
|
3
|
+
> Make a function mimic another one
|
|
4
|
+
|
|
5
|
+
Useful when you wrap a function in another function and like to preserve the original name and other properties.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
$ npm install mimic-fn
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const mimicFn = require('mimic-fn');
|
|
19
|
+
|
|
20
|
+
function foo() {}
|
|
21
|
+
foo.unicorn = '🦄';
|
|
22
|
+
|
|
23
|
+
function wrapper() {
|
|
24
|
+
return foo();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
console.log(wrapper.name);
|
|
28
|
+
//=> 'wrapper'
|
|
29
|
+
|
|
30
|
+
mimicFn(wrapper, foo);
|
|
31
|
+
|
|
32
|
+
console.log(wrapper.name);
|
|
33
|
+
//=> 'foo'
|
|
34
|
+
|
|
35
|
+
console.log(wrapper.unicorn);
|
|
36
|
+
//=> '🦄'
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## API
|
|
41
|
+
|
|
42
|
+
It will copy over the properties `name`, `length`, `displayName`, and any custom properties you may have set.
|
|
43
|
+
|
|
44
|
+
### mimicFn(to, from)
|
|
45
|
+
|
|
46
|
+
Modifies the `to` function and returns it.
|
|
47
|
+
|
|
48
|
+
#### to
|
|
49
|
+
|
|
50
|
+
Type: `Function`
|
|
51
|
+
|
|
52
|
+
Mimicking function.
|
|
53
|
+
|
|
54
|
+
#### from
|
|
55
|
+
|
|
56
|
+
Type: `Function`
|
|
57
|
+
|
|
58
|
+
Function to mimic.
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
## Related
|
|
62
|
+
|
|
63
|
+
- [rename-fn](https://github.com/sindresorhus/rename-fn) - Rename a function
|
|
64
|
+
- [keep-func-props](https://github.com/ehmicky/keep-func-props) - Wrap a function without changing its name, length and other properties
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# minimatch
|
|
2
|
+
|
|
3
|
+
A minimal matching utility.
|
|
4
|
+
|
|
5
|
+
[](http://travis-ci.org/isaacs/minimatch)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
This is the matching library used internally by npm.
|
|
9
|
+
|
|
10
|
+
It works by converting glob expressions into JavaScript `RegExp`
|
|
11
|
+
objects.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
var minimatch = require("minimatch")
|
|
17
|
+
|
|
18
|
+
minimatch("bar.foo", "*.foo") // true!
|
|
19
|
+
minimatch("bar.foo", "*.bar") // false!
|
|
20
|
+
minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy!
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Features
|
|
24
|
+
|
|
25
|
+
Supports these glob features:
|
|
26
|
+
|
|
27
|
+
* Brace Expansion
|
|
28
|
+
* Extended glob matching
|
|
29
|
+
* "Globstar" `**` matching
|
|
30
|
+
|
|
31
|
+
See:
|
|
32
|
+
|
|
33
|
+
* `man sh`
|
|
34
|
+
* `man bash`
|
|
35
|
+
* `man 3 fnmatch`
|
|
36
|
+
* `man 5 gitignore`
|
|
37
|
+
|
|
38
|
+
## Minimatch Class
|
|
39
|
+
|
|
40
|
+
Create a minimatch object by instantiating the `minimatch.Minimatch` class.
|
|
41
|
+
|
|
42
|
+
```javascript
|
|
43
|
+
var Minimatch = require("minimatch").Minimatch
|
|
44
|
+
var mm = new Minimatch(pattern, options)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Properties
|
|
48
|
+
|
|
49
|
+
* `pattern` The original pattern the minimatch object represents.
|
|
50
|
+
* `options` The options supplied to the constructor.
|
|
51
|
+
* `set` A 2-dimensional array of regexp or string expressions.
|
|
52
|
+
Each row in the
|
|
53
|
+
array corresponds to a brace-expanded pattern. Each item in the row
|
|
54
|
+
corresponds to a single path-part. For example, the pattern
|
|
55
|
+
`{a,b/c}/d` would expand to a set of patterns like:
|
|
56
|
+
|
|
57
|
+
[ [ a, d ]
|
|
58
|
+
, [ b, c, d ] ]
|
|
59
|
+
|
|
60
|
+
If a portion of the pattern doesn't have any "magic" in it
|
|
61
|
+
(that is, it's something like `"foo"` rather than `fo*o?`), then it
|
|
62
|
+
will be left as a string rather than converted to a regular
|
|
63
|
+
expression.
|
|
64
|
+
|
|
65
|
+
* `regexp` Created by the `makeRe` method. A single regular expression
|
|
66
|
+
expressing the entire pattern. This is useful in cases where you wish
|
|
67
|
+
to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.
|
|
68
|
+
* `negate` True if the pattern is negated.
|
|
69
|
+
* `comment` True if the pattern is a comment.
|
|
70
|
+
* `empty` True if the pattern is `""`.
|
|
71
|
+
|
|
72
|
+
### Methods
|
|
73
|
+
|
|
74
|
+
* `makeRe` Generate the `regexp` member if necessary, and return it.
|
|
75
|
+
Will return `false` if the pattern is invalid.
|
|
76
|
+
* `match(fname)` Return true if the filename matches the pattern, or
|
|
77
|
+
false otherwise.
|
|
78
|
+
* `matchOne(fileArray, patternArray, partial)` Take a `/`-split
|
|
79
|
+
filename, and match it against a single row in the `regExpSet`. This
|
|
80
|
+
method is mainly for internal use, but is exposed so that it can be
|
|
81
|
+
used by a glob-walker that needs to avoid excessive filesystem calls.
|
|
82
|
+
|
|
83
|
+
All other methods are internal, and will be called as necessary.
|
|
84
|
+
|
|
85
|
+
### minimatch(path, pattern, options)
|
|
86
|
+
|
|
87
|
+
Main export. Tests a path against the pattern using the options.
|
|
88
|
+
|
|
89
|
+
```javascript
|
|
90
|
+
var isJS = minimatch(file, "*.js", { matchBase: true })
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### minimatch.filter(pattern, options)
|
|
94
|
+
|
|
95
|
+
Returns a function that tests its
|
|
96
|
+
supplied argument, suitable for use with `Array.filter`. Example:
|
|
97
|
+
|
|
98
|
+
```javascript
|
|
99
|
+
var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true}))
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### minimatch.match(list, pattern, options)
|
|
103
|
+
|
|
104
|
+
Match against the list of
|
|
105
|
+
files, in the style of fnmatch or glob. If nothing is matched, and
|
|
106
|
+
options.nonull is set, then return a list containing the pattern itself.
|
|
107
|
+
|
|
108
|
+
```javascript
|
|
109
|
+
var javascripts = minimatch.match(fileList, "*.js", {matchBase: true}))
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### minimatch.makeRe(pattern, options)
|
|
113
|
+
|
|
114
|
+
Make a regular expression object from the pattern.
|
|
115
|
+
|
|
116
|
+
## Options
|
|
117
|
+
|
|
118
|
+
All options are `false` by default.
|
|
119
|
+
|
|
120
|
+
### debug
|
|
121
|
+
|
|
122
|
+
Dump a ton of stuff to stderr.
|
|
123
|
+
|
|
124
|
+
### nobrace
|
|
125
|
+
|
|
126
|
+
Do not expand `{a,b}` and `{1..3}` brace sets.
|
|
127
|
+
|
|
128
|
+
### noglobstar
|
|
129
|
+
|
|
130
|
+
Disable `**` matching against multiple folder names.
|
|
131
|
+
|
|
132
|
+
### dot
|
|
133
|
+
|
|
134
|
+
Allow patterns to match filenames starting with a period, even if
|
|
135
|
+
the pattern does not explicitly have a period in that spot.
|
|
136
|
+
|
|
137
|
+
Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`
|
|
138
|
+
is set.
|
|
139
|
+
|
|
140
|
+
### noext
|
|
141
|
+
|
|
142
|
+
Disable "extglob" style patterns like `+(a|b)`.
|
|
143
|
+
|
|
144
|
+
### nocase
|
|
145
|
+
|
|
146
|
+
Perform a case-insensitive match.
|
|
147
|
+
|
|
148
|
+
### nonull
|
|
149
|
+
|
|
150
|
+
When a match is not found by `minimatch.match`, return a list containing
|
|
151
|
+
the pattern itself if this option is set. When not set, an empty list
|
|
152
|
+
is returned if there are no matches.
|
|
153
|
+
|
|
154
|
+
### matchBase
|
|
155
|
+
|
|
156
|
+
If set, then patterns without slashes will be matched
|
|
157
|
+
against the basename of the path if it contains slashes. For example,
|
|
158
|
+
`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.
|
|
159
|
+
|
|
160
|
+
### nocomment
|
|
161
|
+
|
|
162
|
+
Suppress the behavior of treating `#` at the start of a pattern as a
|
|
163
|
+
comment.
|
|
164
|
+
|
|
165
|
+
### nonegate
|
|
166
|
+
|
|
167
|
+
Suppress the behavior of treating a leading `!` character as negation.
|
|
168
|
+
|
|
169
|
+
### flipNegate
|
|
170
|
+
|
|
171
|
+
Returns from negate expressions the same as if they were not negated.
|
|
172
|
+
(Ie, true on a hit, false on a miss.)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
## Comparisons to other fnmatch/glob implementations
|
|
176
|
+
|
|
177
|
+
While strict compliance with the existing standards is a worthwhile
|
|
178
|
+
goal, some discrepancies exist between minimatch and other
|
|
179
|
+
implementations, and are intentional.
|
|
180
|
+
|
|
181
|
+
If the pattern starts with a `!` character, then it is negated. Set the
|
|
182
|
+
`nonegate` flag to suppress this behavior, and treat leading `!`
|
|
183
|
+
characters normally. This is perhaps relevant if you wish to start the
|
|
184
|
+
pattern with a negative extglob pattern like `!(a|B)`. Multiple `!`
|
|
185
|
+
characters at the start of a pattern will negate the pattern multiple
|
|
186
|
+
times.
|
|
187
|
+
|
|
188
|
+
If a pattern starts with `#`, then it is treated as a comment, and
|
|
189
|
+
will not match anything. Use `\#` to match a literal `#` at the
|
|
190
|
+
start of a line, or set the `nocomment` flag to suppress this behavior.
|
|
191
|
+
|
|
192
|
+
The double-star character `**` is supported by default, unless the
|
|
193
|
+
`noglobstar` flag is set. This is supported in the manner of bsdglob
|
|
194
|
+
and bash 4.1, where `**` only has special significance if it is the only
|
|
195
|
+
thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but
|
|
196
|
+
`a/**b` will not.
|
|
197
|
+
|
|
198
|
+
If an escaped pattern has no matches, and the `nonull` flag is set,
|
|
199
|
+
then minimatch.match returns the pattern as-provided, rather than
|
|
200
|
+
interpreting the character escapes. For example,
|
|
201
|
+
`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
|
|
202
|
+
`"*a?"`. This is akin to setting the `nullglob` option in bash, except
|
|
203
|
+
that it does not resolve escaped pattern characters.
|
|
204
|
+
|
|
205
|
+
If brace expansion is not disabled, then it is performed before any
|
|
206
|
+
other interpretation of the glob pattern. Thus, a pattern like
|
|
207
|
+
`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
|
|
208
|
+
**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
|
|
209
|
+
checked for validity. Since those two are valid, matching proceeds.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# ms
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/zeit/ms)
|
|
4
|
+
[](https://spectrum.chat/zeit)
|
|
5
|
+
|
|
6
|
+
Use this package to easily convert various time formats to milliseconds.
|
|
7
|
+
|
|
8
|
+
## Examples
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
ms('2 days') // 172800000
|
|
12
|
+
ms('1d') // 86400000
|
|
13
|
+
ms('10h') // 36000000
|
|
14
|
+
ms('2.5 hrs') // 9000000
|
|
15
|
+
ms('2h') // 7200000
|
|
16
|
+
ms('1m') // 60000
|
|
17
|
+
ms('5s') // 5000
|
|
18
|
+
ms('1y') // 31557600000
|
|
19
|
+
ms('100') // 100
|
|
20
|
+
ms('-3 days') // -259200000
|
|
21
|
+
ms('-1h') // -3600000
|
|
22
|
+
ms('-200') // -200
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Convert from Milliseconds
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
ms(60000) // "1m"
|
|
29
|
+
ms(2 * 60000) // "2m"
|
|
30
|
+
ms(-3 * 60000) // "-3m"
|
|
31
|
+
ms(ms('10 hours')) // "10h"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Time Format Written-Out
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
ms(60000, { long: true }) // "1 minute"
|
|
38
|
+
ms(2 * 60000, { long: true }) // "2 minutes"
|
|
39
|
+
ms(-3 * 60000, { long: true }) // "-3 minutes"
|
|
40
|
+
ms(ms('10 hours'), { long: true }) // "10 hours"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
- Works both in [Node.js](https://nodejs.org) and in the browser
|
|
46
|
+
- If a number is supplied to `ms`, a string with a unit is returned
|
|
47
|
+
- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`)
|
|
48
|
+
- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned
|
|
49
|
+
|
|
50
|
+
## Related Packages
|
|
51
|
+
|
|
52
|
+
- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time.
|
|
53
|
+
|
|
54
|
+
## Caught a Bug?
|
|
55
|
+
|
|
56
|
+
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
|
|
57
|
+
2. Link the package to the global module directory: `npm link`
|
|
58
|
+
3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms!
|
|
59
|
+
|
|
60
|
+
As always, you can run the tests using: `npm test`
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# npm-run-path [](https://travis-ci.org/sindresorhus/npm-run-path)
|
|
2
|
+
|
|
3
|
+
> Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries
|
|
4
|
+
|
|
5
|
+
In [npm run scripts](https://docs.npmjs.com/cli/run-script) you can execute locally installed binaries by name. This enables the same outside npm.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
$ npm install npm-run-path
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const childProcess = require('child_process');
|
|
19
|
+
const npmRunPath = require('npm-run-path');
|
|
20
|
+
|
|
21
|
+
console.log(process.env.PATH);
|
|
22
|
+
//=> '/usr/local/bin'
|
|
23
|
+
|
|
24
|
+
console.log(npmRunPath());
|
|
25
|
+
//=> '/Users/sindresorhus/dev/foo/node_modules/.bin:/Users/sindresorhus/dev/node_modules/.bin:/Users/sindresorhus/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/usr/local/bin'
|
|
26
|
+
|
|
27
|
+
// `foo` is a locally installed binary
|
|
28
|
+
childProcess.execFileSync('foo', {
|
|
29
|
+
env: npmRunPath.env()
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## API
|
|
35
|
+
|
|
36
|
+
### npmRunPath(options?)
|
|
37
|
+
|
|
38
|
+
Returns the augmented path string.
|
|
39
|
+
|
|
40
|
+
#### options
|
|
41
|
+
|
|
42
|
+
Type: `object`
|
|
43
|
+
|
|
44
|
+
##### cwd
|
|
45
|
+
|
|
46
|
+
Type: `string`<br>
|
|
47
|
+
Default: `process.cwd()`
|
|
48
|
+
|
|
49
|
+
Working directory.
|
|
50
|
+
|
|
51
|
+
##### path
|
|
52
|
+
|
|
53
|
+
Type: `string`<br>
|
|
54
|
+
Default: [`PATH`](https://github.com/sindresorhus/path-key)
|
|
55
|
+
|
|
56
|
+
PATH to be appended.<br>
|
|
57
|
+
Set it to an empty string to exclude the default PATH.
|
|
58
|
+
|
|
59
|
+
##### execPath
|
|
60
|
+
|
|
61
|
+
Type: `string`<br>
|
|
62
|
+
Default: `process.execPath`
|
|
63
|
+
|
|
64
|
+
Path to the current Node.js executable. Its directory is pushed to the front of PATH.
|
|
65
|
+
|
|
66
|
+
This can be either an absolute path or a path relative to the [`cwd` option](#cwd).
|
|
67
|
+
|
|
68
|
+
### npmRunPath.env(options?)
|
|
69
|
+
|
|
70
|
+
Returns the augmented [`process.env`](https://nodejs.org/api/process.html#process_process_env) object.
|
|
71
|
+
|
|
72
|
+
#### options
|
|
73
|
+
|
|
74
|
+
Type: `object`
|
|
75
|
+
|
|
76
|
+
##### cwd
|
|
77
|
+
|
|
78
|
+
Type: `string`<br>
|
|
79
|
+
Default: `process.cwd()`
|
|
80
|
+
|
|
81
|
+
Working directory.
|
|
82
|
+
|
|
83
|
+
##### env
|
|
84
|
+
|
|
85
|
+
Type: `Object`
|
|
86
|
+
|
|
87
|
+
Accepts an object of environment variables, like `process.env`, and modifies the PATH using the correct [PATH key](https://github.com/sindresorhus/path-key). Use this if you're modifying the PATH for use in the `child_process` options.
|
|
88
|
+
|
|
89
|
+
##### execPath
|
|
90
|
+
|
|
91
|
+
Type: `string`<br>
|
|
92
|
+
Default: `process.execPath`
|
|
93
|
+
|
|
94
|
+
Path to the Node.js executable to use in child processes if that is different from the current one. Its directory is pushed to the front of PATH.
|
|
95
|
+
|
|
96
|
+
This can be either an absolute path or a path relative to the [`cwd` option](#cwd).
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
## Related
|
|
100
|
+
|
|
101
|
+
- [npm-run-path-cli](https://github.com/sindresorhus/npm-run-path-cli) - CLI for this module
|
|
102
|
+
- [execa](https://github.com/sindresorhus/execa) - Execute a locally installed binary
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
<div align="center">
|
|
108
|
+
<b>
|
|
109
|
+
<a href="https://tidelift.com/subscription/pkg/npm-npm-run-path?utm_source=npm-npm-run-path&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
|
110
|
+
</b>
|
|
111
|
+
<br>
|
|
112
|
+
<sub>
|
|
113
|
+
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
|
114
|
+
</sub>
|
|
115
|
+
</div>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# once
|
|
2
|
+
|
|
3
|
+
Only call a function once.
|
|
4
|
+
|
|
5
|
+
## usage
|
|
6
|
+
|
|
7
|
+
```javascript
|
|
8
|
+
var once = require('once')
|
|
9
|
+
|
|
10
|
+
function load (file, cb) {
|
|
11
|
+
cb = once(cb)
|
|
12
|
+
loader.load('file')
|
|
13
|
+
loader.once('load', cb)
|
|
14
|
+
loader.once('error', cb)
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or add to the Function.prototype in a responsible way:
|
|
19
|
+
|
|
20
|
+
```javascript
|
|
21
|
+
// only has to be done once
|
|
22
|
+
require('once').proto()
|
|
23
|
+
|
|
24
|
+
function load (file, cb) {
|
|
25
|
+
cb = cb.once()
|
|
26
|
+
loader.load('file')
|
|
27
|
+
loader.once('load', cb)
|
|
28
|
+
loader.once('error', cb)
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Ironically, the prototype feature makes this module twice as
|
|
33
|
+
complicated as necessary.
|
|
34
|
+
|
|
35
|
+
To check whether you function has been called, use `fn.called`. Once the
|
|
36
|
+
function is called for the first time the return value of the original
|
|
37
|
+
function is saved in `fn.value` and subsequent calls will continue to
|
|
38
|
+
return this value.
|
|
39
|
+
|
|
40
|
+
```javascript
|
|
41
|
+
var once = require('once')
|
|
42
|
+
|
|
43
|
+
function load (cb) {
|
|
44
|
+
cb = once(cb)
|
|
45
|
+
var stream = createStream()
|
|
46
|
+
stream.once('data', cb)
|
|
47
|
+
stream.once('end', function () {
|
|
48
|
+
if (!cb.called) cb(new Error('not found'))
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## `once.strict(func)`
|
|
54
|
+
|
|
55
|
+
Throw an error if the function is called twice.
|
|
56
|
+
|
|
57
|
+
Some functions are expected to be called only once. Using `once` for them would
|
|
58
|
+
potentially hide logical errors.
|
|
59
|
+
|
|
60
|
+
In the example below, the `greet` function has to call the callback only once:
|
|
61
|
+
|
|
62
|
+
```javascript
|
|
63
|
+
function greet (name, cb) {
|
|
64
|
+
// return is missing from the if statement
|
|
65
|
+
// when no name is passed, the callback is called twice
|
|
66
|
+
if (!name) cb('Hello anonymous')
|
|
67
|
+
cb('Hello ' + name)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function log (msg) {
|
|
71
|
+
console.log(msg)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// this will print 'Hello anonymous' but the logical error will be missed
|
|
75
|
+
greet(null, once(msg))
|
|
76
|
+
|
|
77
|
+
// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time
|
|
78
|
+
greet(null, once.strict(msg))
|
|
79
|
+
```
|