20230730
This commit is contained in:
parent
2974b866c5
commit
13bfda3a54
808 changed files with 28207 additions and 4 deletions
28
index.html
28
index.html
|
@ -16,6 +16,21 @@
|
||||||
.ascii-art {
|
.ascii-art {
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
|
}
|
||||||
|
a:link {
|
||||||
|
color: #8bd5ca;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:visited {
|
||||||
|
color: #8aadf4;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
color: #91d7e3;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:active {
|
||||||
|
color: #7dc4e4;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
@ -40,6 +55,19 @@
|
||||||
⠀⠀⠀⠀⠀⠀⠀⠈⠙⠛⠾⣧⣼⣟⣉⣿⣉⣻⣧⡿⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀
|
⠀⠀⠀⠀⠀⠀⠀⠈⠙⠛⠾⣧⣼⣟⣉⣿⣉⣻⣧⡿⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀
|
||||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||||
</a></div>
|
</a></div>
|
||||||
|
<br>
|
||||||
|
<p>brain genuinely not working with me so instead of thinking of a design, im just gonna write the links down for now:</p>
|
||||||
|
<br>
|
||||||
|
<a href="https://git.ouroboros.group"><u>ForgeJo</u></a>
|
||||||
|
<br>
|
||||||
|
<a href="https://ouroboros.gay"><u>Ouroboros.Gay - Fediverse</u></a>
|
||||||
|
<br>
|
||||||
|
<a href="https://ak.ouroboros.gay"><u>Ouroboros.Gay - Fediverse (Akkoma Version)</u></a>
|
||||||
|
<br>
|
||||||
|
<a href="https://up.ouroboros.group"><u>Uptime Kuma</u></a>
|
||||||
|
<br>
|
||||||
|
<a href="https://limepot.xyz"><u>limepot.xyz - Personal Website</u></a>
|
||||||
|
|
||||||
</center>
|
</center>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
0
mybulma/node_modules/.bin/color-support
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/color-support
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/mkdirp
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/mkdirp
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/node-gyp
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/node-gyp
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/node-sass
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/node-sass
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/node-which
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/node-which
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/nopt
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/nopt
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/resolve
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/resolve
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/rimraf
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/rimraf
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/sassgraph
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/sassgraph
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/semver
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/.bin/semver
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/@types/minimist/LICENSE
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/@types/minimist/LICENSE
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/@types/minimist/README.md
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/@types/minimist/README.md
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/@types/minimist/index.d.ts
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/@types/minimist/index.d.ts
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/@types/minimist/package.json
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/@types/minimist/package.json
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/@types/normalize-package-data/LICENSE
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/@types/normalize-package-data/LICENSE
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/@types/normalize-package-data/README.md
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/@types/normalize-package-data/README.md
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/@types/normalize-package-data/index.d.ts
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/@types/normalize-package-data/index.d.ts
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/@types/normalize-package-data/package.json
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/@types/normalize-package-data/package.json
generated
vendored
Normal file → Executable file
51
mybulma/node_modules/aggregate-error/index.d.ts
generated
vendored
Normal file
51
mybulma/node_modules/aggregate-error/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
/**
|
||||||
|
Create an error from multiple errors.
|
||||||
|
*/
|
||||||
|
declare class AggregateError<T extends Error = Error> extends Error implements Iterable<T> {
|
||||||
|
readonly name: 'AggregateError';
|
||||||
|
|
||||||
|
/**
|
||||||
|
@param errors - If a string, a new `Error` is created with the string as the error message. If a non-Error object, a new `Error` is created with all properties from the object copied over.
|
||||||
|
@returns An Error that is also an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Iterables) for the individual errors.
|
||||||
|
|
||||||
|
@example
|
||||||
|
```
|
||||||
|
import AggregateError = require('aggregate-error');
|
||||||
|
|
||||||
|
const error = new AggregateError([new Error('foo'), 'bar', {message: 'baz'}]);
|
||||||
|
|
||||||
|
throw error;
|
||||||
|
|
||||||
|
// AggregateError:
|
||||||
|
// Error: foo
|
||||||
|
// at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:33)
|
||||||
|
// Error: bar
|
||||||
|
// at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
|
||||||
|
// Error: baz
|
||||||
|
// at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
|
||||||
|
// at AggregateError (/Users/sindresorhus/dev/aggregate-error/index.js:19:3)
|
||||||
|
// at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
|
||||||
|
// at Module._compile (module.js:556:32)
|
||||||
|
// at Object.Module._extensions..js (module.js:565:10)
|
||||||
|
// at Module.load (module.js:473:32)
|
||||||
|
// at tryModuleLoad (module.js:432:12)
|
||||||
|
// at Function.Module._load (module.js:424:3)
|
||||||
|
// at Module.runMain (module.js:590:10)
|
||||||
|
// at run (bootstrap_node.js:394:7)
|
||||||
|
// at startup (bootstrap_node.js:149:9)
|
||||||
|
|
||||||
|
|
||||||
|
for (const individualError of error) {
|
||||||
|
console.log(individualError);
|
||||||
|
}
|
||||||
|
//=> [Error: foo]
|
||||||
|
//=> [Error: bar]
|
||||||
|
//=> [Error: baz]
|
||||||
|
```
|
||||||
|
*/
|
||||||
|
constructor(errors: ReadonlyArray<T | {[key: string]: any} | string>);
|
||||||
|
|
||||||
|
[Symbol.iterator](): IterableIterator<T>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export = AggregateError;
|
47
mybulma/node_modules/aggregate-error/index.js
generated
vendored
Normal file
47
mybulma/node_modules/aggregate-error/index.js
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
'use strict';
|
||||||
|
const indentString = require('indent-string');
|
||||||
|
const cleanStack = require('clean-stack');
|
||||||
|
|
||||||
|
const cleanInternalStack = stack => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, '');
|
||||||
|
|
||||||
|
class AggregateError extends Error {
|
||||||
|
constructor(errors) {
|
||||||
|
if (!Array.isArray(errors)) {
|
||||||
|
throw new TypeError(`Expected input to be an Array, got ${typeof errors}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
errors = [...errors].map(error => {
|
||||||
|
if (error instanceof Error) {
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (error !== null && typeof error === 'object') {
|
||||||
|
// Handle plain error objects with message property and/or possibly other metadata
|
||||||
|
return Object.assign(new Error(error.message), error);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Error(error);
|
||||||
|
});
|
||||||
|
|
||||||
|
let message = errors
|
||||||
|
.map(error => {
|
||||||
|
// The `stack` property is not standardized, so we can't assume it exists
|
||||||
|
return typeof error.stack === 'string' ? cleanInternalStack(cleanStack(error.stack)) : String(error);
|
||||||
|
})
|
||||||
|
.join('\n');
|
||||||
|
message = '\n' + indentString(message, 4);
|
||||||
|
super(message);
|
||||||
|
|
||||||
|
this.name = 'AggregateError';
|
||||||
|
|
||||||
|
Object.defineProperty(this, '_errors', {value: errors});
|
||||||
|
}
|
||||||
|
|
||||||
|
* [Symbol.iterator]() {
|
||||||
|
for (const error of this._errors) {
|
||||||
|
yield error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = AggregateError;
|
9
mybulma/node_modules/aggregate-error/license
generated
vendored
Normal file
9
mybulma/node_modules/aggregate-error/license
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||||
|
|
||||||
|
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.
|
41
mybulma/node_modules/aggregate-error/package.json
generated
vendored
Normal file
41
mybulma/node_modules/aggregate-error/package.json
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
{
|
||||||
|
"name": "aggregate-error",
|
||||||
|
"version": "3.1.0",
|
||||||
|
"description": "Create an error from multiple errors",
|
||||||
|
"license": "MIT",
|
||||||
|
"repository": "sindresorhus/aggregate-error",
|
||||||
|
"author": {
|
||||||
|
"name": "Sindre Sorhus",
|
||||||
|
"email": "sindresorhus@gmail.com",
|
||||||
|
"url": "sindresorhus.com"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "xo && ava && tsd"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"index.js",
|
||||||
|
"index.d.ts"
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
"aggregate",
|
||||||
|
"error",
|
||||||
|
"combine",
|
||||||
|
"multiple",
|
||||||
|
"many",
|
||||||
|
"collection",
|
||||||
|
"iterable",
|
||||||
|
"iterator"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"clean-stack": "^2.0.0",
|
||||||
|
"indent-string": "^4.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"ava": "^2.4.0",
|
||||||
|
"tsd": "^0.7.1",
|
||||||
|
"xo": "^0.25.3"
|
||||||
|
}
|
||||||
|
}
|
61
mybulma/node_modules/aggregate-error/readme.md
generated
vendored
Normal file
61
mybulma/node_modules/aggregate-error/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
# aggregate-error [![Build Status](https://travis-ci.org/sindresorhus/aggregate-error.svg?branch=master)](https://travis-ci.org/sindresorhus/aggregate-error)
|
||||||
|
|
||||||
|
> Create an error from multiple errors
|
||||||
|
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```
|
||||||
|
$ npm install aggregate-error
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```js
|
||||||
|
const AggregateError = require('aggregate-error');
|
||||||
|
|
||||||
|
const error = new AggregateError([new Error('foo'), 'bar', {message: 'baz'}]);
|
||||||
|
|
||||||
|
throw error;
|
||||||
|
/*
|
||||||
|
AggregateError:
|
||||||
|
Error: foo
|
||||||
|
at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:33)
|
||||||
|
Error: bar
|
||||||
|
at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
|
||||||
|
Error: baz
|
||||||
|
at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
|
||||||
|
at AggregateError (/Users/sindresorhus/dev/aggregate-error/index.js:19:3)
|
||||||
|
at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
|
||||||
|
at Module._compile (module.js:556:32)
|
||||||
|
at Object.Module._extensions..js (module.js:565:10)
|
||||||
|
at Module.load (module.js:473:32)
|
||||||
|
at tryModuleLoad (module.js:432:12)
|
||||||
|
at Function.Module._load (module.js:424:3)
|
||||||
|
at Module.runMain (module.js:590:10)
|
||||||
|
at run (bootstrap_node.js:394:7)
|
||||||
|
at startup (bootstrap_node.js:149:9)
|
||||||
|
*/
|
||||||
|
|
||||||
|
for (const individualError of error) {
|
||||||
|
console.log(individualError);
|
||||||
|
}
|
||||||
|
//=> [Error: foo]
|
||||||
|
//=> [Error: bar]
|
||||||
|
//=> [Error: baz]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
### AggregateError(errors)
|
||||||
|
|
||||||
|
Returns an `Error` that is also an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Iterables) for the individual errors.
|
||||||
|
|
||||||
|
#### errors
|
||||||
|
|
||||||
|
Type: `Array<Error|Object|string>`
|
||||||
|
|
||||||
|
If a string, a new `Error` is created with the string as the error message.<br>
|
||||||
|
If a non-Error object, a new `Error` is created with all properties from the object copied over.
|
4
mybulma/node_modules/aproba/CHANGELOG.md
generated
vendored
Normal file
4
mybulma/node_modules/aproba/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
2.0.0
|
||||||
|
* Drop support for 0.10 and 0.12. They haven't been in travis but still,
|
||||||
|
since we _know_ we'll break with them now it's only polite to do a
|
||||||
|
major bump.
|
14
mybulma/node_modules/aproba/LICENSE
generated
vendored
Normal file
14
mybulma/node_modules/aproba/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
Copyright (c) 2015, Rebecca Turner <me@re-becca.org>
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
94
mybulma/node_modules/aproba/README.md
generated
vendored
Normal file
94
mybulma/node_modules/aproba/README.md
generated
vendored
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
aproba
|
||||||
|
======
|
||||||
|
|
||||||
|
A ridiculously light-weight function argument validator
|
||||||
|
|
||||||
|
```
|
||||||
|
var validate = require("aproba")
|
||||||
|
|
||||||
|
function myfunc(a, b, c) {
|
||||||
|
// `a` must be a string, `b` a number, `c` a function
|
||||||
|
validate('SNF', arguments) // [a,b,c] is also valid
|
||||||
|
}
|
||||||
|
|
||||||
|
myfunc('test', 23, function () {}) // ok
|
||||||
|
myfunc(123, 23, function () {}) // type error
|
||||||
|
myfunc('test', 23) // missing arg error
|
||||||
|
myfunc('test', 23, function () {}, true) // too many args error
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Valid types are:
|
||||||
|
|
||||||
|
| type | description
|
||||||
|
| :--: | :----------
|
||||||
|
| * | matches any type
|
||||||
|
| A | `Array.isArray` OR an `arguments` object
|
||||||
|
| S | typeof == string
|
||||||
|
| N | typeof == number
|
||||||
|
| F | typeof == function
|
||||||
|
| O | typeof == object and not type A and not type E
|
||||||
|
| B | typeof == boolean
|
||||||
|
| E | `instanceof Error` OR `null` **(special: see below)**
|
||||||
|
| Z | == `null`
|
||||||
|
|
||||||
|
Validation failures throw one of three exception types, distinguished by a
|
||||||
|
`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`.
|
||||||
|
|
||||||
|
If you pass in an invalid type then it will throw with a code of
|
||||||
|
`EUNKNOWNTYPE`.
|
||||||
|
|
||||||
|
If an **error** argument is found and is not null then the remaining
|
||||||
|
arguments are optional. That is, if you say `ESO` then that's like using a
|
||||||
|
non-magical `E` in: `E|ESO|ZSO`.
|
||||||
|
|
||||||
|
### But I have optional arguments?!
|
||||||
|
|
||||||
|
You can provide more than one signature by separating them with pipes `|`.
|
||||||
|
If any signature matches the arguments then they'll be considered valid.
|
||||||
|
|
||||||
|
So for example, say you wanted to write a signature for
|
||||||
|
`fs.createWriteStream`. The docs for it describe it thusly:
|
||||||
|
|
||||||
|
```
|
||||||
|
fs.createWriteStream(path[, options])
|
||||||
|
```
|
||||||
|
|
||||||
|
This would be a signature of `SO|S`. That is, a string and and object, or
|
||||||
|
just a string.
|
||||||
|
|
||||||
|
Now, if you read the full `fs` docs, you'll see that actually path can ALSO
|
||||||
|
be a buffer. And options can be a string, that is:
|
||||||
|
```
|
||||||
|
path <String> | <Buffer>
|
||||||
|
options <String> | <Object>
|
||||||
|
```
|
||||||
|
|
||||||
|
To reproduce this you have to fully enumerate all of the possible
|
||||||
|
combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The
|
||||||
|
awkwardness is a feature: It reminds you of the complexity you're adding to
|
||||||
|
your API when you do this sort of thing.
|
||||||
|
|
||||||
|
|
||||||
|
### Browser support
|
||||||
|
|
||||||
|
This has no dependencies and should work in browsers, though you'll have
|
||||||
|
noisier stack traces.
|
||||||
|
|
||||||
|
### Why this exists
|
||||||
|
|
||||||
|
I wanted a very simple argument validator. It needed to do two things:
|
||||||
|
|
||||||
|
1. Be more concise and easier to use than assertions
|
||||||
|
|
||||||
|
2. Not encourage an infinite bikeshed of DSLs
|
||||||
|
|
||||||
|
This is why types are specified by a single character and there's no such
|
||||||
|
thing as an optional argument.
|
||||||
|
|
||||||
|
This is not intended to validate user data. This is specifically about
|
||||||
|
asserting the interface of your functions.
|
||||||
|
|
||||||
|
If you need greater validation, I encourage you to write them by hand or
|
||||||
|
look elsewhere.
|
||||||
|
|
105
mybulma/node_modules/aproba/index.js
generated
vendored
Normal file
105
mybulma/node_modules/aproba/index.js
generated
vendored
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
'use strict'
|
||||||
|
module.exports = validate
|
||||||
|
|
||||||
|
function isArguments (thingy) {
|
||||||
|
return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee')
|
||||||
|
}
|
||||||
|
|
||||||
|
const types = {
|
||||||
|
'*': {label: 'any', check: () => true},
|
||||||
|
A: {label: 'array', check: _ => Array.isArray(_) || isArguments(_)},
|
||||||
|
S: {label: 'string', check: _ => typeof _ === 'string'},
|
||||||
|
N: {label: 'number', check: _ => typeof _ === 'number'},
|
||||||
|
F: {label: 'function', check: _ => typeof _ === 'function'},
|
||||||
|
O: {label: 'object', check: _ => typeof _ === 'object' && _ != null && !types.A.check(_) && !types.E.check(_)},
|
||||||
|
B: {label: 'boolean', check: _ => typeof _ === 'boolean'},
|
||||||
|
E: {label: 'error', check: _ => _ instanceof Error},
|
||||||
|
Z: {label: 'null', check: _ => _ == null}
|
||||||
|
}
|
||||||
|
|
||||||
|
function addSchema (schema, arity) {
|
||||||
|
const group = arity[schema.length] = arity[schema.length] || []
|
||||||
|
if (group.indexOf(schema) === -1) group.push(schema)
|
||||||
|
}
|
||||||
|
|
||||||
|
function validate (rawSchemas, args) {
|
||||||
|
if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length)
|
||||||
|
if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas')
|
||||||
|
if (!args) throw missingRequiredArg(1, 'args')
|
||||||
|
if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas)
|
||||||
|
if (!types.A.check(args)) throw invalidType(1, ['array'], args)
|
||||||
|
const schemas = rawSchemas.split('|')
|
||||||
|
const arity = {}
|
||||||
|
|
||||||
|
schemas.forEach(schema => {
|
||||||
|
for (let ii = 0; ii < schema.length; ++ii) {
|
||||||
|
const type = schema[ii]
|
||||||
|
if (!types[type]) throw unknownType(ii, type)
|
||||||
|
}
|
||||||
|
if (/E.*E/.test(schema)) throw moreThanOneError(schema)
|
||||||
|
addSchema(schema, arity)
|
||||||
|
if (/E/.test(schema)) {
|
||||||
|
addSchema(schema.replace(/E.*$/, 'E'), arity)
|
||||||
|
addSchema(schema.replace(/E/, 'Z'), arity)
|
||||||
|
if (schema.length === 1) addSchema('', arity)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
let matching = arity[args.length]
|
||||||
|
if (!matching) {
|
||||||
|
throw wrongNumberOfArgs(Object.keys(arity), args.length)
|
||||||
|
}
|
||||||
|
for (let ii = 0; ii < args.length; ++ii) {
|
||||||
|
let newMatching = matching.filter(schema => {
|
||||||
|
const type = schema[ii]
|
||||||
|
const typeCheck = types[type].check
|
||||||
|
return typeCheck(args[ii])
|
||||||
|
})
|
||||||
|
if (!newMatching.length) {
|
||||||
|
const labels = matching.map(_ => types[_[ii]].label).filter(_ => _ != null)
|
||||||
|
throw invalidType(ii, labels, args[ii])
|
||||||
|
}
|
||||||
|
matching = newMatching
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function missingRequiredArg (num) {
|
||||||
|
return newException('EMISSINGARG', 'Missing required argument #' + (num + 1))
|
||||||
|
}
|
||||||
|
|
||||||
|
function unknownType (num, type) {
|
||||||
|
return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1))
|
||||||
|
}
|
||||||
|
|
||||||
|
function invalidType (num, expectedTypes, value) {
|
||||||
|
let valueType
|
||||||
|
Object.keys(types).forEach(typeCode => {
|
||||||
|
if (types[typeCode].check(value)) valueType = types[typeCode].label
|
||||||
|
})
|
||||||
|
return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' +
|
||||||
|
englishList(expectedTypes) + ' but got ' + valueType)
|
||||||
|
}
|
||||||
|
|
||||||
|
function englishList (list) {
|
||||||
|
return list.join(', ').replace(/, ([^,]+)$/, ' or $1')
|
||||||
|
}
|
||||||
|
|
||||||
|
function wrongNumberOfArgs (expected, got) {
|
||||||
|
const english = englishList(expected)
|
||||||
|
const args = expected.every(ex => ex.length === 1)
|
||||||
|
? 'argument'
|
||||||
|
: 'arguments'
|
||||||
|
return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got)
|
||||||
|
}
|
||||||
|
|
||||||
|
function moreThanOneError (schema) {
|
||||||
|
return newException('ETOOMANYERRORTYPES',
|
||||||
|
'Only one error type per argument signature is allowed, more than one found in "' + schema + '"')
|
||||||
|
}
|
||||||
|
|
||||||
|
function newException (code, msg) {
|
||||||
|
const err = new Error(msg)
|
||||||
|
err.code = code
|
||||||
|
/* istanbul ignore else */
|
||||||
|
if (Error.captureStackTrace) Error.captureStackTrace(err, validate)
|
||||||
|
return err
|
||||||
|
}
|
35
mybulma/node_modules/aproba/package.json
generated
vendored
Normal file
35
mybulma/node_modules/aproba/package.json
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"name": "aproba",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"description": "A ridiculously light-weight argument validator (now browser friendly)",
|
||||||
|
"main": "index.js",
|
||||||
|
"directories": {
|
||||||
|
"test": "test"
|
||||||
|
},
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"standard": "^11.0.1",
|
||||||
|
"tap": "^12.0.1"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"index.js"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"pretest": "standard",
|
||||||
|
"test": "tap --100 -J test/*.js"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/iarna/aproba"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"argument",
|
||||||
|
"validate"
|
||||||
|
],
|
||||||
|
"author": "Rebecca Turner <me@re-becca.org>",
|
||||||
|
"license": "ISC",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/iarna/aproba/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/iarna/aproba"
|
||||||
|
}
|
22
mybulma/node_modules/async-foreach/LICENSE-MIT
generated
vendored
Normal file
22
mybulma/node_modules/async-foreach/LICENSE-MIT
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
Copyright (c) 2011 "Cowboy" Ben Alman
|
||||||
|
|
||||||
|
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.
|
195
mybulma/node_modules/async-foreach/README.md
generated
vendored
Normal file
195
mybulma/node_modules/async-foreach/README.md
generated
vendored
Normal file
|
@ -0,0 +1,195 @@
|
||||||
|
# JavaScript Sync/Async forEach
|
||||||
|
|
||||||
|
An optionally-asynchronous forEach with an interesting interface.
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
This code should work just fine in Node.js:
|
||||||
|
|
||||||
|
First, install the module with: `npm install async-foreach`
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var forEach = require('async-foreach').forEach;
|
||||||
|
forEach(["a", "b", "c"], function(item, index, arr) {
|
||||||
|
console.log("each", item, index, arr);
|
||||||
|
});
|
||||||
|
// logs:
|
||||||
|
// each a 0 ["a", "b", "c"]
|
||||||
|
// each b 1 ["a", "b", "c"]
|
||||||
|
// each c 2 ["a", "b", "c"]
|
||||||
|
```
|
||||||
|
|
||||||
|
Or in the browser:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script src="dist/ba-foreach.min.js"></script>
|
||||||
|
<script>
|
||||||
|
forEach(["a", "b", "c"], function(item, index, arr) {
|
||||||
|
console.log("each", item, index, arr);
|
||||||
|
});
|
||||||
|
// logs:
|
||||||
|
// each a 0 ["a", "b", "c"]
|
||||||
|
// each b 1 ["a", "b", "c"]
|
||||||
|
// each c 2 ["a", "b", "c"]
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
In the browser, you can attach the forEach method to any object.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script>
|
||||||
|
this.exports = Bocoup.utils;
|
||||||
|
</script>
|
||||||
|
<script src="dist/ba-foreach.min.js"></script>
|
||||||
|
<script>
|
||||||
|
Bocoup.utils.forEach(["a", "b", "c"], function(item, index, arr) {
|
||||||
|
console.log("each", item, index, arr);
|
||||||
|
});
|
||||||
|
// logs:
|
||||||
|
// each a 0 ["a", "b", "c"]
|
||||||
|
// each b 1 ["a", "b", "c"]
|
||||||
|
// each c 2 ["a", "b", "c"]
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
## The General Idea (Why I thought this was worth sharing)
|
||||||
|
|
||||||
|
The idea is to allow the callback to decide _at runtime_ whether the loop will be synchronous or asynchronous. By using `this` in a creative way (in situations where that value isn't already spoken for), an entire control API can be offered without over-complicating function signatures.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
forEach(arr, function(item, index) {
|
||||||
|
// Synchronous.
|
||||||
|
});
|
||||||
|
|
||||||
|
forEach(arr, function(item, index) {
|
||||||
|
// Only when `this.async` is called does iteration becomes asynchronous. The
|
||||||
|
// loop won't be continued until the `done` function is executed.
|
||||||
|
var done = this.async();
|
||||||
|
// Continue in one second.
|
||||||
|
setTimeout(done, 1000);
|
||||||
|
});
|
||||||
|
|
||||||
|
forEach(arr, function(item, index) {
|
||||||
|
// Break out of synchronous iteration early by returning false.
|
||||||
|
return index !== 1;
|
||||||
|
});
|
||||||
|
|
||||||
|
forEach(arr, function(item, index) {
|
||||||
|
// Break out of asynchronous iteration early...
|
||||||
|
var done = this.async();
|
||||||
|
// ...by passing false to the done function.
|
||||||
|
setTimeout(function() {
|
||||||
|
done(index !== 1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
See the unit tests for more examples.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Generic "done" callback.
|
||||||
|
function allDone(notAborted, arr) {
|
||||||
|
console.log("done", notAborted, arr);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Synchronous.
|
||||||
|
forEach(["a", "b", "c"], function(item, index, arr) {
|
||||||
|
console.log("each", item, index, arr);
|
||||||
|
}, allDone);
|
||||||
|
// logs:
|
||||||
|
// each a 0 ["a", "b", "c"]
|
||||||
|
// each b 1 ["a", "b", "c"]
|
||||||
|
// each c 2 ["a", "b", "c"]
|
||||||
|
// done true ["a", "b", "c"]
|
||||||
|
|
||||||
|
// Synchronous with early abort.
|
||||||
|
forEach(["a", "b", "c"], function(item, index, arr) {
|
||||||
|
console.log("each", item, index, arr);
|
||||||
|
if (item === "b") { return false; }
|
||||||
|
}, allDone);
|
||||||
|
// logs:
|
||||||
|
// each a 0 ["a", "b", "c"]
|
||||||
|
// each b 1 ["a", "b", "c"]
|
||||||
|
// done false ["a", "b", "c"]
|
||||||
|
|
||||||
|
// Asynchronous.
|
||||||
|
forEach(["a", "b", "c"], function(item, index, arr) {
|
||||||
|
console.log("each", item, index, arr);
|
||||||
|
var done = this.async();
|
||||||
|
setTimeout(function() {
|
||||||
|
done();
|
||||||
|
}, 500);
|
||||||
|
}, allDone);
|
||||||
|
// logs:
|
||||||
|
// each a 0 ["a", "b", "c"]
|
||||||
|
// each b 1 ["a", "b", "c"]
|
||||||
|
// each c 2 ["a", "b", "c"]
|
||||||
|
// done true ["a", "b", "c"]
|
||||||
|
|
||||||
|
// Asynchronous with early abort.
|
||||||
|
forEach(["a", "b", "c"], function(item, index, arr) {
|
||||||
|
console.log("each", item, index, arr);
|
||||||
|
var done = this.async();
|
||||||
|
setTimeout(function() {
|
||||||
|
done(item !== "b");
|
||||||
|
}, 500);
|
||||||
|
}, allDone);
|
||||||
|
// logs:
|
||||||
|
// each a 0 ["a", "b", "c"]
|
||||||
|
// each b 1 ["a", "b", "c"]
|
||||||
|
// done false ["a", "b", "c"]
|
||||||
|
|
||||||
|
// Not actually asynchronous.
|
||||||
|
forEach(["a", "b", "c"], function(item, index, arr) {
|
||||||
|
console.log("each", item, index, arr);
|
||||||
|
var done = this.async()
|
||||||
|
done();
|
||||||
|
}, allDone);
|
||||||
|
// logs:
|
||||||
|
// each a 0 ["a", "b", "c"]
|
||||||
|
// each b 1 ["a", "b", "c"]
|
||||||
|
// each c 2 ["a", "b", "c"]
|
||||||
|
// done true ["a", "b", "c"]
|
||||||
|
|
||||||
|
// Not actually asynchronous with early abort.
|
||||||
|
forEach(["a", "b", "c"], function(item, index, arr) {
|
||||||
|
console.log("each", item, index, arr);
|
||||||
|
var done = this.async();
|
||||||
|
done(item !== "b");
|
||||||
|
}, allDone);
|
||||||
|
// logs:
|
||||||
|
// each a 0 ["a", "b", "c"]
|
||||||
|
// each b 1 ["a", "b", "c"]
|
||||||
|
// done false ["a", "b", "c"]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt).
|
||||||
|
|
||||||
|
_Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "lib" subdirectory!_
|
||||||
|
|
||||||
|
## Release History
|
||||||
|
|
||||||
|
04/29/2013
|
||||||
|
v0.1.3
|
||||||
|
Removed hard Node.js version dependency.
|
||||||
|
|
||||||
|
11/17/2011
|
||||||
|
v0.1.2
|
||||||
|
Adding sparse array support.
|
||||||
|
Invalid length properties are now sanitized.
|
||||||
|
This closes issue #1 (like a boss).
|
||||||
|
|
||||||
|
11/11/2011
|
||||||
|
v0.1.1
|
||||||
|
Refactored code to be much simpler. Yay for unit tests!
|
||||||
|
|
||||||
|
11/11/2011
|
||||||
|
v0.1.0
|
||||||
|
Initial Release.
|
||||||
|
|
||||||
|
## License
|
||||||
|
Copyright (c) 2012 "Cowboy" Ben Alman
|
||||||
|
Licensed under the MIT license.
|
||||||
|
<http://benalman.com/about/license/>
|
48
mybulma/node_modules/async-foreach/grunt.js
generated
vendored
Normal file
48
mybulma/node_modules/async-foreach/grunt.js
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
/*global config:true, task:true*/
|
||||||
|
config.init({
|
||||||
|
pkg: '<json:package.json>',
|
||||||
|
meta: {
|
||||||
|
title: 'JavaScript Sync/Async forEach',
|
||||||
|
license: ['MIT'],
|
||||||
|
copyright: 'Copyright (c) 2012 "Cowboy" Ben Alman',
|
||||||
|
banner: '/* {{meta.title}} - v{{pkg.version}} - {{today "m/d/yyyy"}}\n' +
|
||||||
|
' * {{pkg.homepage}}\n' +
|
||||||
|
' * {{{meta.copyright}}}; Licensed {{join meta.license}} */'
|
||||||
|
},
|
||||||
|
concat: {
|
||||||
|
'dist/ba-foreach.js': ['<banner>', '<file_strip_banner:lib/foreach.js>']
|
||||||
|
},
|
||||||
|
min: {
|
||||||
|
'dist/ba-foreach.min.js': ['<banner>', 'dist/ba-foreach.js']
|
||||||
|
},
|
||||||
|
test: {
|
||||||
|
files: ['test/**/*.js']
|
||||||
|
},
|
||||||
|
lint: {
|
||||||
|
files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js']
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
files: '<config:lint.files>',
|
||||||
|
tasks: 'lint:files test:files'
|
||||||
|
},
|
||||||
|
jshint: {
|
||||||
|
options: {
|
||||||
|
curly: true,
|
||||||
|
eqeqeq: true,
|
||||||
|
immed: true,
|
||||||
|
latedef: true,
|
||||||
|
newcap: true,
|
||||||
|
noarg: true,
|
||||||
|
sub: true,
|
||||||
|
undef: true,
|
||||||
|
eqnull: true
|
||||||
|
},
|
||||||
|
globals: {
|
||||||
|
exports: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
uglify: {}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Default task.
|
||||||
|
task.registerTask('default', 'lint:files test:files concat min');
|
25
mybulma/node_modules/async-foreach/package.json
generated
vendored
Normal file
25
mybulma/node_modules/async-foreach/package.json
generated
vendored
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
"author": "\"Cowboy\" Ben Alman (http://benalman.com/)",
|
||||||
|
"name": "async-foreach",
|
||||||
|
"description": "An optionally-asynchronous forEach with an interesting interface.",
|
||||||
|
"version": "0.1.3",
|
||||||
|
"homepage": "http://github.com/cowboy/javascript-sync-async-foreach",
|
||||||
|
"bugs": "https://github.com/cowboy/javascript-sync-async-foreach/issues",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/cowboy/javascript-sync-async-foreach.git"
|
||||||
|
},
|
||||||
|
"main": "lib/foreach",
|
||||||
|
"engines": {
|
||||||
|
"node": "*"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"array",
|
||||||
|
"loop",
|
||||||
|
"sync",
|
||||||
|
"async",
|
||||||
|
"foreach"
|
||||||
|
],
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {}
|
||||||
|
}
|
21
mybulma/node_modules/brace-expansion/LICENSE
generated
vendored
Normal file
21
mybulma/node_modules/brace-expansion/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
||||||
|
|
||||||
|
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.
|
129
mybulma/node_modules/brace-expansion/README.md
generated
vendored
Normal file
129
mybulma/node_modules/brace-expansion/README.md
generated
vendored
Normal file
|
@ -0,0 +1,129 @@
|
||||||
|
# brace-expansion
|
||||||
|
|
||||||
|
[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
|
||||||
|
as known from sh/bash, in JavaScript.
|
||||||
|
|
||||||
|
[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion)
|
||||||
|
[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion)
|
||||||
|
[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/)
|
||||||
|
|
||||||
|
[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion)
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```js
|
||||||
|
var expand = require('brace-expansion');
|
||||||
|
|
||||||
|
expand('file-{a,b,c}.jpg')
|
||||||
|
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
|
||||||
|
|
||||||
|
expand('-v{,,}')
|
||||||
|
// => ['-v', '-v', '-v']
|
||||||
|
|
||||||
|
expand('file{0..2}.jpg')
|
||||||
|
// => ['file0.jpg', 'file1.jpg', 'file2.jpg']
|
||||||
|
|
||||||
|
expand('file-{a..c}.jpg')
|
||||||
|
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
|
||||||
|
|
||||||
|
expand('file{2..0}.jpg')
|
||||||
|
// => ['file2.jpg', 'file1.jpg', 'file0.jpg']
|
||||||
|
|
||||||
|
expand('file{0..4..2}.jpg')
|
||||||
|
// => ['file0.jpg', 'file2.jpg', 'file4.jpg']
|
||||||
|
|
||||||
|
expand('file-{a..e..2}.jpg')
|
||||||
|
// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']
|
||||||
|
|
||||||
|
expand('file{00..10..5}.jpg')
|
||||||
|
// => ['file00.jpg', 'file05.jpg', 'file10.jpg']
|
||||||
|
|
||||||
|
expand('{{A..C},{a..c}}')
|
||||||
|
// => ['A', 'B', 'C', 'a', 'b', 'c']
|
||||||
|
|
||||||
|
expand('ppp{,config,oe{,conf}}')
|
||||||
|
// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
|
||||||
|
```
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
```js
|
||||||
|
var expand = require('brace-expansion');
|
||||||
|
```
|
||||||
|
|
||||||
|
### var expanded = expand(str)
|
||||||
|
|
||||||
|
Return an array of all possible and valid expansions of `str`. If none are
|
||||||
|
found, `[str]` is returned.
|
||||||
|
|
||||||
|
Valid expansions are:
|
||||||
|
|
||||||
|
```js
|
||||||
|
/^(.*,)+(.+)?$/
|
||||||
|
// {a,b,...}
|
||||||
|
```
|
||||||
|
|
||||||
|
A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
|
||||||
|
|
||||||
|
```js
|
||||||
|
/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
|
||||||
|
// {x..y[..incr]}
|
||||||
|
```
|
||||||
|
|
||||||
|
A numeric sequence from `x` to `y` inclusive, with optional increment.
|
||||||
|
If `x` or `y` start with a leading `0`, all the numbers will be padded
|
||||||
|
to have equal length. Negative numbers and backwards iteration work too.
|
||||||
|
|
||||||
|
```js
|
||||||
|
/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
|
||||||
|
// {x..y[..incr]}
|
||||||
|
```
|
||||||
|
|
||||||
|
An alphabetic sequence from `x` to `y` inclusive, with optional increment.
|
||||||
|
`x` and `y` must be exactly one character, and if given, `incr` must be a
|
||||||
|
number.
|
||||||
|
|
||||||
|
For compatibility reasons, the string `${` is not eligible for brace expansion.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
With [npm](https://npmjs.org) do:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install brace-expansion
|
||||||
|
```
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
- [Julian Gruber](https://github.com/juliangruber)
|
||||||
|
- [Isaac Z. Schlueter](https://github.com/isaacs)
|
||||||
|
|
||||||
|
## Sponsors
|
||||||
|
|
||||||
|
This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!
|
||||||
|
|
||||||
|
Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
(MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
||||||
|
|
||||||
|
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.
|
201
mybulma/node_modules/brace-expansion/index.js
generated
vendored
Normal file
201
mybulma/node_modules/brace-expansion/index.js
generated
vendored
Normal file
|
@ -0,0 +1,201 @@
|
||||||
|
var concatMap = require('concat-map');
|
||||||
|
var balanced = require('balanced-match');
|
||||||
|
|
||||||
|
module.exports = expandTop;
|
||||||
|
|
||||||
|
var escSlash = '\0SLASH'+Math.random()+'\0';
|
||||||
|
var escOpen = '\0OPEN'+Math.random()+'\0';
|
||||||
|
var escClose = '\0CLOSE'+Math.random()+'\0';
|
||||||
|
var escComma = '\0COMMA'+Math.random()+'\0';
|
||||||
|
var escPeriod = '\0PERIOD'+Math.random()+'\0';
|
||||||
|
|
||||||
|
function numeric(str) {
|
||||||
|
return parseInt(str, 10) == str
|
||||||
|
? parseInt(str, 10)
|
||||||
|
: str.charCodeAt(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function escapeBraces(str) {
|
||||||
|
return str.split('\\\\').join(escSlash)
|
||||||
|
.split('\\{').join(escOpen)
|
||||||
|
.split('\\}').join(escClose)
|
||||||
|
.split('\\,').join(escComma)
|
||||||
|
.split('\\.').join(escPeriod);
|
||||||
|
}
|
||||||
|
|
||||||
|
function unescapeBraces(str) {
|
||||||
|
return str.split(escSlash).join('\\')
|
||||||
|
.split(escOpen).join('{')
|
||||||
|
.split(escClose).join('}')
|
||||||
|
.split(escComma).join(',')
|
||||||
|
.split(escPeriod).join('.');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Basically just str.split(","), but handling cases
|
||||||
|
// where we have nested braced sections, which should be
|
||||||
|
// treated as individual members, like {a,{b,c},d}
|
||||||
|
function parseCommaParts(str) {
|
||||||
|
if (!str)
|
||||||
|
return [''];
|
||||||
|
|
||||||
|
var parts = [];
|
||||||
|
var m = balanced('{', '}', str);
|
||||||
|
|
||||||
|
if (!m)
|
||||||
|
return str.split(',');
|
||||||
|
|
||||||
|
var pre = m.pre;
|
||||||
|
var body = m.body;
|
||||||
|
var post = m.post;
|
||||||
|
var p = pre.split(',');
|
||||||
|
|
||||||
|
p[p.length-1] += '{' + body + '}';
|
||||||
|
var postParts = parseCommaParts(post);
|
||||||
|
if (post.length) {
|
||||||
|
p[p.length-1] += postParts.shift();
|
||||||
|
p.push.apply(p, postParts);
|
||||||
|
}
|
||||||
|
|
||||||
|
parts.push.apply(parts, p);
|
||||||
|
|
||||||
|
return parts;
|
||||||
|
}
|
||||||
|
|
||||||
|
function expandTop(str) {
|
||||||
|
if (!str)
|
||||||
|
return [];
|
||||||
|
|
||||||
|
// I don't know why Bash 4.3 does this, but it does.
|
||||||
|
// Anything starting with {} will have the first two bytes preserved
|
||||||
|
// but *only* at the top level, so {},a}b will not expand to anything,
|
||||||
|
// but a{},b}c will be expanded to [a}c,abc].
|
||||||
|
// One could argue that this is a bug in Bash, but since the goal of
|
||||||
|
// this module is to match Bash's rules, we escape a leading {}
|
||||||
|
if (str.substr(0, 2) === '{}') {
|
||||||
|
str = '\\{\\}' + str.substr(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
return expand(escapeBraces(str), true).map(unescapeBraces);
|
||||||
|
}
|
||||||
|
|
||||||
|
function identity(e) {
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
function embrace(str) {
|
||||||
|
return '{' + str + '}';
|
||||||
|
}
|
||||||
|
function isPadded(el) {
|
||||||
|
return /^-?0\d/.test(el);
|
||||||
|
}
|
||||||
|
|
||||||
|
function lte(i, y) {
|
||||||
|
return i <= y;
|
||||||
|
}
|
||||||
|
function gte(i, y) {
|
||||||
|
return i >= y;
|
||||||
|
}
|
||||||
|
|
||||||
|
function expand(str, isTop) {
|
||||||
|
var expansions = [];
|
||||||
|
|
||||||
|
var m = balanced('{', '}', str);
|
||||||
|
if (!m || /\$$/.test(m.pre)) return [str];
|
||||||
|
|
||||||
|
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
||||||
|
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
||||||
|
var isSequence = isNumericSequence || isAlphaSequence;
|
||||||
|
var isOptions = m.body.indexOf(',') >= 0;
|
||||||
|
if (!isSequence && !isOptions) {
|
||||||
|
// {a},b}
|
||||||
|
if (m.post.match(/,.*\}/)) {
|
||||||
|
str = m.pre + '{' + m.body + escClose + m.post;
|
||||||
|
return expand(str);
|
||||||
|
}
|
||||||
|
return [str];
|
||||||
|
}
|
||||||
|
|
||||||
|
var n;
|
||||||
|
if (isSequence) {
|
||||||
|
n = m.body.split(/\.\./);
|
||||||
|
} else {
|
||||||
|
n = parseCommaParts(m.body);
|
||||||
|
if (n.length === 1) {
|
||||||
|
// x{{a,b}}y ==> x{a}y x{b}y
|
||||||
|
n = expand(n[0], false).map(embrace);
|
||||||
|
if (n.length === 1) {
|
||||||
|
var post = m.post.length
|
||||||
|
? expand(m.post, false)
|
||||||
|
: [''];
|
||||||
|
return post.map(function(p) {
|
||||||
|
return m.pre + n[0] + p;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// at this point, n is the parts, and we know it's not a comma set
|
||||||
|
// with a single entry.
|
||||||
|
|
||||||
|
// no need to expand pre, since it is guaranteed to be free of brace-sets
|
||||||
|
var pre = m.pre;
|
||||||
|
var post = m.post.length
|
||||||
|
? expand(m.post, false)
|
||||||
|
: [''];
|
||||||
|
|
||||||
|
var N;
|
||||||
|
|
||||||
|
if (isSequence) {
|
||||||
|
var x = numeric(n[0]);
|
||||||
|
var y = numeric(n[1]);
|
||||||
|
var width = Math.max(n[0].length, n[1].length)
|
||||||
|
var incr = n.length == 3
|
||||||
|
? Math.abs(numeric(n[2]))
|
||||||
|
: 1;
|
||||||
|
var test = lte;
|
||||||
|
var reverse = y < x;
|
||||||
|
if (reverse) {
|
||||||
|
incr *= -1;
|
||||||
|
test = gte;
|
||||||
|
}
|
||||||
|
var pad = n.some(isPadded);
|
||||||
|
|
||||||
|
N = [];
|
||||||
|
|
||||||
|
for (var i = x; test(i, y); i += incr) {
|
||||||
|
var c;
|
||||||
|
if (isAlphaSequence) {
|
||||||
|
c = String.fromCharCode(i);
|
||||||
|
if (c === '\\')
|
||||||
|
c = '';
|
||||||
|
} else {
|
||||||
|
c = String(i);
|
||||||
|
if (pad) {
|
||||||
|
var need = width - c.length;
|
||||||
|
if (need > 0) {
|
||||||
|
var z = new Array(need + 1).join('0');
|
||||||
|
if (i < 0)
|
||||||
|
c = '-' + z + c.slice(1);
|
||||||
|
else
|
||||||
|
c = z + c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
N.push(c);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
N = concatMap(n, function(el) { return expand(el, false) });
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var j = 0; j < N.length; j++) {
|
||||||
|
for (var k = 0; k < post.length; k++) {
|
||||||
|
var expansion = pre + N[j] + post[k];
|
||||||
|
if (!isTop || isSequence || expansion)
|
||||||
|
expansions.push(expansion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return expansions;
|
||||||
|
}
|
||||||
|
|
47
mybulma/node_modules/brace-expansion/package.json
generated
vendored
Normal file
47
mybulma/node_modules/brace-expansion/package.json
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
{
|
||||||
|
"name": "brace-expansion",
|
||||||
|
"description": "Brace expansion as known from sh/bash",
|
||||||
|
"version": "1.1.11",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/juliangruber/brace-expansion.git"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/juliangruber/brace-expansion",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "tape test/*.js",
|
||||||
|
"gentest": "bash test/generate.sh",
|
||||||
|
"bench": "matcha test/perf/bench.js"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"balanced-match": "^1.0.0",
|
||||||
|
"concat-map": "0.0.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"matcha": "^0.7.0",
|
||||||
|
"tape": "^4.6.0"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": {
|
||||||
|
"name": "Julian Gruber",
|
||||||
|
"email": "mail@juliangruber.com",
|
||||||
|
"url": "http://juliangruber.com"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"testling": {
|
||||||
|
"files": "test/*.js",
|
||||||
|
"browsers": [
|
||||||
|
"ie/8..latest",
|
||||||
|
"firefox/20..latest",
|
||||||
|
"firefox/nightly",
|
||||||
|
"chrome/25..latest",
|
||||||
|
"chrome/canary",
|
||||||
|
"opera/12..latest",
|
||||||
|
"opera/next",
|
||||||
|
"safari/5.1..latest",
|
||||||
|
"ipad/6.0..latest",
|
||||||
|
"iphone/6.0..latest",
|
||||||
|
"android-browser/4.2..latest"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
415
mybulma/node_modules/chalk/index.d.ts
generated
vendored
Normal file
415
mybulma/node_modules/chalk/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,415 @@
|
||||||
|
/**
|
||||||
|
Basic foreground colors.
|
||||||
|
|
||||||
|
[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support)
|
||||||
|
*/
|
||||||
|
declare type ForegroundColor =
|
||||||
|
| 'black'
|
||||||
|
| 'red'
|
||||||
|
| 'green'
|
||||||
|
| 'yellow'
|
||||||
|
| 'blue'
|
||||||
|
| 'magenta'
|
||||||
|
| 'cyan'
|
||||||
|
| 'white'
|
||||||
|
| 'gray'
|
||||||
|
| 'grey'
|
||||||
|
| 'blackBright'
|
||||||
|
| 'redBright'
|
||||||
|
| 'greenBright'
|
||||||
|
| 'yellowBright'
|
||||||
|
| 'blueBright'
|
||||||
|
| 'magentaBright'
|
||||||
|
| 'cyanBright'
|
||||||
|
| 'whiteBright';
|
||||||
|
|
||||||
|
/**
|
||||||
|
Basic background colors.
|
||||||
|
|
||||||
|
[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support)
|
||||||
|
*/
|
||||||
|
declare type BackgroundColor =
|
||||||
|
| 'bgBlack'
|
||||||
|
| 'bgRed'
|
||||||
|
| 'bgGreen'
|
||||||
|
| 'bgYellow'
|
||||||
|
| 'bgBlue'
|
||||||
|
| 'bgMagenta'
|
||||||
|
| 'bgCyan'
|
||||||
|
| 'bgWhite'
|
||||||
|
| 'bgGray'
|
||||||
|
| 'bgGrey'
|
||||||
|
| 'bgBlackBright'
|
||||||
|
| 'bgRedBright'
|
||||||
|
| 'bgGreenBright'
|
||||||
|
| 'bgYellowBright'
|
||||||
|
| 'bgBlueBright'
|
||||||
|
| 'bgMagentaBright'
|
||||||
|
| 'bgCyanBright'
|
||||||
|
| 'bgWhiteBright';
|
||||||
|
|
||||||
|
/**
|
||||||
|
Basic colors.
|
||||||
|
|
||||||
|
[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support)
|
||||||
|
*/
|
||||||
|
declare type Color = ForegroundColor | BackgroundColor;
|
||||||
|
|
||||||
|
declare type Modifiers =
|
||||||
|
| 'reset'
|
||||||
|
| 'bold'
|
||||||
|
| 'dim'
|
||||||
|
| 'italic'
|
||||||
|
| 'underline'
|
||||||
|
| 'inverse'
|
||||||
|
| 'hidden'
|
||||||
|
| 'strikethrough'
|
||||||
|
| 'visible';
|
||||||
|
|
||||||
|
declare namespace chalk {
|
||||||
|
/**
|
||||||
|
Levels:
|
||||||
|
- `0` - All colors disabled.
|
||||||
|
- `1` - Basic 16 colors support.
|
||||||
|
- `2` - ANSI 256 colors support.
|
||||||
|
- `3` - Truecolor 16 million colors support.
|
||||||
|
*/
|
||||||
|
type Level = 0 | 1 | 2 | 3;
|
||||||
|
|
||||||
|
interface Options {
|
||||||
|
/**
|
||||||
|
Specify the color support for Chalk.
|
||||||
|
|
||||||
|
By default, color support is automatically detected based on the environment.
|
||||||
|
|
||||||
|
Levels:
|
||||||
|
- `0` - All colors disabled.
|
||||||
|
- `1` - Basic 16 colors support.
|
||||||
|
- `2` - ANSI 256 colors support.
|
||||||
|
- `3` - Truecolor 16 million colors support.
|
||||||
|
*/
|
||||||
|
level?: Level;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Return a new Chalk instance.
|
||||||
|
*/
|
||||||
|
type Instance = new (options?: Options) => Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Detect whether the terminal supports color.
|
||||||
|
*/
|
||||||
|
interface ColorSupport {
|
||||||
|
/**
|
||||||
|
The color level used by Chalk.
|
||||||
|
*/
|
||||||
|
level: Level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Return whether Chalk supports basic 16 colors.
|
||||||
|
*/
|
||||||
|
hasBasic: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Return whether Chalk supports ANSI 256 colors.
|
||||||
|
*/
|
||||||
|
has256: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Return whether Chalk supports Truecolor 16 million colors.
|
||||||
|
*/
|
||||||
|
has16m: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ChalkFunction {
|
||||||
|
/**
|
||||||
|
Use a template string.
|
||||||
|
|
||||||
|
@remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341))
|
||||||
|
|
||||||
|
@example
|
||||||
|
```
|
||||||
|
import chalk = require('chalk');
|
||||||
|
|
||||||
|
log(chalk`
|
||||||
|
CPU: {red ${cpu.totalPercent}%}
|
||||||
|
RAM: {green ${ram.used / ram.total * 100}%}
|
||||||
|
DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
|
||||||
|
`);
|
||||||
|
```
|
||||||
|
|
||||||
|
@example
|
||||||
|
```
|
||||||
|
import chalk = require('chalk');
|
||||||
|
|
||||||
|
log(chalk.red.bgBlack`2 + 3 = {bold ${2 + 3}}`)
|
||||||
|
```
|
||||||
|
*/
|
||||||
|
(text: TemplateStringsArray, ...placeholders: unknown[]): string;
|
||||||
|
|
||||||
|
(...text: unknown[]): string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Chalk extends ChalkFunction {
|
||||||
|
/**
|
||||||
|
Return a new Chalk instance.
|
||||||
|
*/
|
||||||
|
Instance: Instance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
The color support for Chalk.
|
||||||
|
|
||||||
|
By default, color support is automatically detected based on the environment.
|
||||||
|
|
||||||
|
Levels:
|
||||||
|
- `0` - All colors disabled.
|
||||||
|
- `1` - Basic 16 colors support.
|
||||||
|
- `2` - ANSI 256 colors support.
|
||||||
|
- `3` - Truecolor 16 million colors support.
|
||||||
|
*/
|
||||||
|
level: Level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Use HEX value to set text color.
|
||||||
|
|
||||||
|
@param color - Hexadecimal value representing the desired color.
|
||||||
|
|
||||||
|
@example
|
||||||
|
```
|
||||||
|
import chalk = require('chalk');
|
||||||
|
|
||||||
|
chalk.hex('#DEADED');
|
||||||
|
```
|
||||||
|
*/
|
||||||
|
hex(color: string): Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Use keyword color value to set text color.
|
||||||
|
|
||||||
|
@param color - Keyword value representing the desired color.
|
||||||
|
|
||||||
|
@example
|
||||||
|
```
|
||||||
|
import chalk = require('chalk');
|
||||||
|
|
||||||
|
chalk.keyword('orange');
|
||||||
|
```
|
||||||
|
*/
|
||||||
|
keyword(color: string): Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Use RGB values to set text color.
|
||||||
|
*/
|
||||||
|
rgb(red: number, green: number, blue: number): Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Use HSL values to set text color.
|
||||||
|
*/
|
||||||
|
hsl(hue: number, saturation: number, lightness: number): Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Use HSV values to set text color.
|
||||||
|
*/
|
||||||
|
hsv(hue: number, saturation: number, value: number): Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Use HWB values to set text color.
|
||||||
|
*/
|
||||||
|
hwb(hue: number, whiteness: number, blackness: number): Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color.
|
||||||
|
|
||||||
|
30 <= code && code < 38 || 90 <= code && code < 98
|
||||||
|
For example, 31 for red, 91 for redBright.
|
||||||
|
*/
|
||||||
|
ansi(code: number): Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
|
||||||
|
*/
|
||||||
|
ansi256(index: number): Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Use HEX value to set background color.
|
||||||
|
|
||||||
|
@param color - Hexadecimal value representing the desired color.
|
||||||
|
|
||||||
|
@example
|
||||||
|
```
|
||||||
|
import chalk = require('chalk');
|
||||||
|
|
||||||
|
chalk.bgHex('#DEADED');
|
||||||
|
```
|
||||||
|
*/
|
||||||
|
bgHex(color: string): Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Use keyword color value to set background color.
|
||||||
|
|
||||||
|
@param color - Keyword value representing the desired color.
|
||||||
|
|
||||||
|
@example
|
||||||
|
```
|
||||||
|
import chalk = require('chalk');
|
||||||
|
|
||||||
|
chalk.bgKeyword('orange');
|
||||||
|
```
|
||||||
|
*/
|
||||||
|
bgKeyword(color: string): Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Use RGB values to set background color.
|
||||||
|
*/
|
||||||
|
bgRgb(red: number, green: number, blue: number): Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Use HSL values to set background color.
|
||||||
|
*/
|
||||||
|
bgHsl(hue: number, saturation: number, lightness: number): Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Use HSV values to set background color.
|
||||||
|
*/
|
||||||
|
bgHsv(hue: number, saturation: number, value: number): Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Use HWB values to set background color.
|
||||||
|
*/
|
||||||
|
bgHwb(hue: number, whiteness: number, blackness: number): Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color.
|
||||||
|
|
||||||
|
30 <= code && code < 38 || 90 <= code && code < 98
|
||||||
|
For example, 31 for red, 91 for redBright.
|
||||||
|
Use the foreground code, not the background code (for example, not 41, nor 101).
|
||||||
|
*/
|
||||||
|
bgAnsi(code: number): Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color.
|
||||||
|
*/
|
||||||
|
bgAnsi256(index: number): Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Modifier: Resets the current color chain.
|
||||||
|
*/
|
||||||
|
readonly reset: Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Modifier: Make text bold.
|
||||||
|
*/
|
||||||
|
readonly bold: Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Modifier: Emitting only a small amount of light.
|
||||||
|
*/
|
||||||
|
readonly dim: Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Modifier: Make text italic. (Not widely supported)
|
||||||
|
*/
|
||||||
|
readonly italic: Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Modifier: Make text underline. (Not widely supported)
|
||||||
|
*/
|
||||||
|
readonly underline: Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Modifier: Inverse background and foreground colors.
|
||||||
|
*/
|
||||||
|
readonly inverse: Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Modifier: Prints the text, but makes it invisible.
|
||||||
|
*/
|
||||||
|
readonly hidden: Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Modifier: Puts a horizontal line through the center of the text. (Not widely supported)
|
||||||
|
*/
|
||||||
|
readonly strikethrough: Chalk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Modifier: Prints the text only when Chalk has a color support level > 0.
|
||||||
|
Can be useful for things that are purely cosmetic.
|
||||||
|
*/
|
||||||
|
readonly visible: Chalk;
|
||||||
|
|
||||||
|
readonly black: Chalk;
|
||||||
|
readonly red: Chalk;
|
||||||
|
readonly green: Chalk;
|
||||||
|
readonly yellow: Chalk;
|
||||||
|
readonly blue: Chalk;
|
||||||
|
readonly magenta: Chalk;
|
||||||
|
readonly cyan: Chalk;
|
||||||
|
readonly white: Chalk;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Alias for `blackBright`.
|
||||||
|
*/
|
||||||
|
readonly gray: Chalk;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Alias for `blackBright`.
|
||||||
|
*/
|
||||||
|
readonly grey: Chalk;
|
||||||
|
|
||||||
|
readonly blackBright: Chalk;
|
||||||
|
readonly redBright: Chalk;
|
||||||
|
readonly greenBright: Chalk;
|
||||||
|
readonly yellowBright: Chalk;
|
||||||
|
readonly blueBright: Chalk;
|
||||||
|
readonly magentaBright: Chalk;
|
||||||
|
readonly cyanBright: Chalk;
|
||||||
|
readonly whiteBright: Chalk;
|
||||||
|
|
||||||
|
readonly bgBlack: Chalk;
|
||||||
|
readonly bgRed: Chalk;
|
||||||
|
readonly bgGreen: Chalk;
|
||||||
|
readonly bgYellow: Chalk;
|
||||||
|
readonly bgBlue: Chalk;
|
||||||
|
readonly bgMagenta: Chalk;
|
||||||
|
readonly bgCyan: Chalk;
|
||||||
|
readonly bgWhite: Chalk;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Alias for `bgBlackBright`.
|
||||||
|
*/
|
||||||
|
readonly bgGray: Chalk;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Alias for `bgBlackBright`.
|
||||||
|
*/
|
||||||
|
readonly bgGrey: Chalk;
|
||||||
|
|
||||||
|
readonly bgBlackBright: Chalk;
|
||||||
|
readonly bgRedBright: Chalk;
|
||||||
|
readonly bgGreenBright: Chalk;
|
||||||
|
readonly bgYellowBright: Chalk;
|
||||||
|
readonly bgBlueBright: Chalk;
|
||||||
|
readonly bgMagentaBright: Chalk;
|
||||||
|
readonly bgCyanBright: Chalk;
|
||||||
|
readonly bgWhiteBright: Chalk;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Main Chalk object that allows to chain styles together.
|
||||||
|
Call the last one as a method with a string argument.
|
||||||
|
Order doesn't matter, and later styles take precedent in case of a conflict.
|
||||||
|
This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
|
||||||
|
*/
|
||||||
|
declare const chalk: chalk.Chalk & chalk.ChalkFunction & {
|
||||||
|
supportsColor: chalk.ColorSupport | false;
|
||||||
|
Level: chalk.Level;
|
||||||
|
Color: Color;
|
||||||
|
ForegroundColor: ForegroundColor;
|
||||||
|
BackgroundColor: BackgroundColor;
|
||||||
|
Modifiers: Modifiers;
|
||||||
|
stderr: chalk.Chalk & {supportsColor: chalk.ColorSupport | false};
|
||||||
|
};
|
||||||
|
|
||||||
|
export = chalk;
|
9
mybulma/node_modules/chalk/license
generated
vendored
Normal file
9
mybulma/node_modules/chalk/license
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||||
|
|
||||||
|
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.
|
68
mybulma/node_modules/chalk/package.json
generated
vendored
Normal file
68
mybulma/node_modules/chalk/package.json
generated
vendored
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
{
|
||||||
|
"name": "chalk",
|
||||||
|
"version": "4.1.2",
|
||||||
|
"description": "Terminal string styling done right",
|
||||||
|
"license": "MIT",
|
||||||
|
"repository": "chalk/chalk",
|
||||||
|
"funding": "https://github.com/chalk/chalk?sponsor=1",
|
||||||
|
"main": "source",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "xo && nyc ava && tsd",
|
||||||
|
"bench": "matcha benchmark.js"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"source",
|
||||||
|
"index.d.ts"
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
"color",
|
||||||
|
"colour",
|
||||||
|
"colors",
|
||||||
|
"terminal",
|
||||||
|
"console",
|
||||||
|
"cli",
|
||||||
|
"string",
|
||||||
|
"str",
|
||||||
|
"ansi",
|
||||||
|
"style",
|
||||||
|
"styles",
|
||||||
|
"tty",
|
||||||
|
"formatting",
|
||||||
|
"rgb",
|
||||||
|
"256",
|
||||||
|
"shell",
|
||||||
|
"xterm",
|
||||||
|
"log",
|
||||||
|
"logging",
|
||||||
|
"command-line",
|
||||||
|
"text"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-styles": "^4.1.0",
|
||||||
|
"supports-color": "^7.1.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"ava": "^2.4.0",
|
||||||
|
"coveralls": "^3.0.7",
|
||||||
|
"execa": "^4.0.0",
|
||||||
|
"import-fresh": "^3.1.0",
|
||||||
|
"matcha": "^0.7.0",
|
||||||
|
"nyc": "^15.0.0",
|
||||||
|
"resolve-from": "^5.0.0",
|
||||||
|
"tsd": "^0.7.4",
|
||||||
|
"xo": "^0.28.2"
|
||||||
|
},
|
||||||
|
"xo": {
|
||||||
|
"rules": {
|
||||||
|
"unicorn/prefer-string-slice": "off",
|
||||||
|
"unicorn/prefer-includes": "off",
|
||||||
|
"@typescript-eslint/member-ordering": "off",
|
||||||
|
"no-redeclare": "off",
|
||||||
|
"unicorn/string-content": "off",
|
||||||
|
"unicorn/better-regex": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
341
mybulma/node_modules/chalk/readme.md
generated
vendored
Normal file
341
mybulma/node_modules/chalk/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,341 @@
|
||||||
|
<h1 align="center">
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<img width="320" src="media/logo.svg" alt="Chalk">
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
> Terminal string styling done right
|
||||||
|
|
||||||
|
[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg) [![run on repl.it](https://repl.it/badge/github/chalk/chalk)](https://repl.it/github/chalk/chalk)
|
||||||
|
|
||||||
|
<img src="https://cdn.jsdelivr.net/gh/chalk/ansi-styles@8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900">
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<p>
|
||||||
|
<p>
|
||||||
|
<sup>
|
||||||
|
Sindre Sorhus' open source work is supported by the community on <a href="https://github.com/sponsors/sindresorhus">GitHub Sponsors</a> and <a href="https://stakes.social/0x44d871aebF0126Bf646753E2C976Aa7e68A66c15">Dev</a>
|
||||||
|
</sup>
|
||||||
|
</p>
|
||||||
|
<sup>Special thanks to:</sup>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<a href="https://standardresume.co/tech">
|
||||||
|
<img src="https://sindresorhus.com/assets/thanks/standard-resume-logo.svg" width="160"/>
|
||||||
|
</a>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<a href="https://retool.com/?utm_campaign=sindresorhus">
|
||||||
|
<img src="https://sindresorhus.com/assets/thanks/retool-logo.svg" width="230"/>
|
||||||
|
</a>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<a href="https://doppler.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=chalk&utm_source=github">
|
||||||
|
<div>
|
||||||
|
<img src="https://dashboard.doppler.com/imgs/logo-long.svg" width="240" alt="Doppler">
|
||||||
|
</div>
|
||||||
|
<b>All your environment variables, in one place</b>
|
||||||
|
<div>
|
||||||
|
<span>Stop struggling with scattered API keys, hacking together home-brewed tools,</span>
|
||||||
|
<br>
|
||||||
|
<span>and avoiding access controls. Keep your team and servers in sync with Doppler.</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
<br>
|
||||||
|
<a href="https://uibakery.io/?utm_source=chalk&utm_medium=sponsor&utm_campaign=github">
|
||||||
|
<div>
|
||||||
|
<img src="https://sindresorhus.com/assets/thanks/uibakery-logo.jpg" width="270" alt="UI Bakery">
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
## Highlights
|
||||||
|
|
||||||
|
- Expressive API
|
||||||
|
- Highly performant
|
||||||
|
- Ability to nest styles
|
||||||
|
- [256/Truecolor color support](#256-and-truecolor-color-support)
|
||||||
|
- Auto-detects color support
|
||||||
|
- Doesn't extend `String.prototype`
|
||||||
|
- Clean and focused
|
||||||
|
- Actively maintained
|
||||||
|
- [Used by ~50,000 packages](https://www.npmjs.com/browse/depended/chalk) as of January 1, 2020
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ npm install chalk
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```js
|
||||||
|
const chalk = require('chalk');
|
||||||
|
|
||||||
|
console.log(chalk.blue('Hello world!'));
|
||||||
|
```
|
||||||
|
|
||||||
|
Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const chalk = require('chalk');
|
||||||
|
const log = console.log;
|
||||||
|
|
||||||
|
// Combine styled and normal strings
|
||||||
|
log(chalk.blue('Hello') + ' World' + chalk.red('!'));
|
||||||
|
|
||||||
|
// Compose multiple styles using the chainable API
|
||||||
|
log(chalk.blue.bgRed.bold('Hello world!'));
|
||||||
|
|
||||||
|
// Pass in multiple arguments
|
||||||
|
log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'));
|
||||||
|
|
||||||
|
// Nest styles
|
||||||
|
log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!'));
|
||||||
|
|
||||||
|
// Nest styles of the same type even (color, underline, background)
|
||||||
|
log(chalk.green(
|
||||||
|
'I am a green line ' +
|
||||||
|
chalk.blue.underline.bold('with a blue substring') +
|
||||||
|
' that becomes green again!'
|
||||||
|
));
|
||||||
|
|
||||||
|
// ES2015 template literal
|
||||||
|
log(`
|
||||||
|
CPU: ${chalk.red('90%')}
|
||||||
|
RAM: ${chalk.green('40%')}
|
||||||
|
DISK: ${chalk.yellow('70%')}
|
||||||
|
`);
|
||||||
|
|
||||||
|
// ES2015 tagged template literal
|
||||||
|
log(chalk`
|
||||||
|
CPU: {red ${cpu.totalPercent}%}
|
||||||
|
RAM: {green ${ram.used / ram.total * 100}%}
|
||||||
|
DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
|
||||||
|
`);
|
||||||
|
|
||||||
|
// Use RGB colors in terminal emulators that support it.
|
||||||
|
log(chalk.keyword('orange')('Yay for orange colored text!'));
|
||||||
|
log(chalk.rgb(123, 45, 67).underline('Underlined reddish color'));
|
||||||
|
log(chalk.hex('#DEADED').bold('Bold gray!'));
|
||||||
|
```
|
||||||
|
|
||||||
|
Easily define your own themes:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const chalk = require('chalk');
|
||||||
|
|
||||||
|
const error = chalk.bold.red;
|
||||||
|
const warning = chalk.keyword('orange');
|
||||||
|
|
||||||
|
console.log(error('Error!'));
|
||||||
|
console.log(warning('Warning!'));
|
||||||
|
```
|
||||||
|
|
||||||
|
Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args):
|
||||||
|
|
||||||
|
```js
|
||||||
|
const name = 'Sindre';
|
||||||
|
console.log(chalk.green('Hello %s'), name);
|
||||||
|
//=> 'Hello Sindre'
|
||||||
|
```
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
### chalk.`<style>[.<style>...](string, [string...])`
|
||||||
|
|
||||||
|
Example: `chalk.red.bold.underline('Hello', 'world');`
|
||||||
|
|
||||||
|
Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
|
||||||
|
|
||||||
|
Multiple arguments will be separated by space.
|
||||||
|
|
||||||
|
### chalk.level
|
||||||
|
|
||||||
|
Specifies the level of color support.
|
||||||
|
|
||||||
|
Color support is automatically detected, but you can override it by setting the `level` property. You should however only do this in your own code as it applies globally to all Chalk consumers.
|
||||||
|
|
||||||
|
If you need to change this in a reusable module, create a new instance:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const ctx = new chalk.Instance({level: 0});
|
||||||
|
```
|
||||||
|
|
||||||
|
| Level | Description |
|
||||||
|
| :---: | :--- |
|
||||||
|
| `0` | All colors disabled |
|
||||||
|
| `1` | Basic color support (16 colors) |
|
||||||
|
| `2` | 256 color support |
|
||||||
|
| `3` | Truecolor support (16 million colors) |
|
||||||
|
|
||||||
|
### chalk.supportsColor
|
||||||
|
|
||||||
|
Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
|
||||||
|
|
||||||
|
Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
|
||||||
|
|
||||||
|
Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
|
||||||
|
|
||||||
|
### chalk.stderr and chalk.stderr.supportsColor
|
||||||
|
|
||||||
|
`chalk.stderr` contains a separate instance configured with color support detected for `stderr` stream instead of `stdout`. Override rules from `chalk.supportsColor` apply to this too. `chalk.stderr.supportsColor` is exposed for convenience.
|
||||||
|
|
||||||
|
## Styles
|
||||||
|
|
||||||
|
### Modifiers
|
||||||
|
|
||||||
|
- `reset` - Resets the current color chain.
|
||||||
|
- `bold` - Make text bold.
|
||||||
|
- `dim` - Emitting only a small amount of light.
|
||||||
|
- `italic` - Make text italic. *(Not widely supported)*
|
||||||
|
- `underline` - Make text underline. *(Not widely supported)*
|
||||||
|
- `inverse`- Inverse background and foreground colors.
|
||||||
|
- `hidden` - Prints the text, but makes it invisible.
|
||||||
|
- `strikethrough` - Puts a horizontal line through the center of the text. *(Not widely supported)*
|
||||||
|
- `visible`- Prints the text only when Chalk has a color level > 0. Can be useful for things that are purely cosmetic.
|
||||||
|
|
||||||
|
### Colors
|
||||||
|
|
||||||
|
- `black`
|
||||||
|
- `red`
|
||||||
|
- `green`
|
||||||
|
- `yellow`
|
||||||
|
- `blue`
|
||||||
|
- `magenta`
|
||||||
|
- `cyan`
|
||||||
|
- `white`
|
||||||
|
- `blackBright` (alias: `gray`, `grey`)
|
||||||
|
- `redBright`
|
||||||
|
- `greenBright`
|
||||||
|
- `yellowBright`
|
||||||
|
- `blueBright`
|
||||||
|
- `magentaBright`
|
||||||
|
- `cyanBright`
|
||||||
|
- `whiteBright`
|
||||||
|
|
||||||
|
### Background colors
|
||||||
|
|
||||||
|
- `bgBlack`
|
||||||
|
- `bgRed`
|
||||||
|
- `bgGreen`
|
||||||
|
- `bgYellow`
|
||||||
|
- `bgBlue`
|
||||||
|
- `bgMagenta`
|
||||||
|
- `bgCyan`
|
||||||
|
- `bgWhite`
|
||||||
|
- `bgBlackBright` (alias: `bgGray`, `bgGrey`)
|
||||||
|
- `bgRedBright`
|
||||||
|
- `bgGreenBright`
|
||||||
|
- `bgYellowBright`
|
||||||
|
- `bgBlueBright`
|
||||||
|
- `bgMagentaBright`
|
||||||
|
- `bgCyanBright`
|
||||||
|
- `bgWhiteBright`
|
||||||
|
|
||||||
|
## Tagged template literal
|
||||||
|
|
||||||
|
Chalk can be used as a [tagged template literal](https://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).
|
||||||
|
|
||||||
|
```js
|
||||||
|
const chalk = require('chalk');
|
||||||
|
|
||||||
|
const miles = 18;
|
||||||
|
const calculateFeet = miles => miles * 5280;
|
||||||
|
|
||||||
|
console.log(chalk`
|
||||||
|
There are {bold 5280 feet} in a mile.
|
||||||
|
In {bold ${miles} miles}, there are {green.bold ${calculateFeet(miles)} feet}.
|
||||||
|
`);
|
||||||
|
```
|
||||||
|
|
||||||
|
Blocks are delimited by an opening curly brace (`{`), a style, some content, and a closing curly brace (`}`).
|
||||||
|
|
||||||
|
Template styles are chained exactly like normal Chalk styles. The following three statements are equivalent:
|
||||||
|
|
||||||
|
```js
|
||||||
|
console.log(chalk.bold.rgb(10, 100, 200)('Hello!'));
|
||||||
|
console.log(chalk.bold.rgb(10, 100, 200)`Hello!`);
|
||||||
|
console.log(chalk`{bold.rgb(10,100,200) Hello!}`);
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that function styles (`rgb()`, `hsl()`, `keyword()`, etc.) may not contain spaces between parameters.
|
||||||
|
|
||||||
|
All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped.
|
||||||
|
|
||||||
|
## 256 and Truecolor color support
|
||||||
|
|
||||||
|
Chalk supports 256 colors and [Truecolor](https://gist.github.com/XVilka/8346728) (16 million colors) on supported terminal apps.
|
||||||
|
|
||||||
|
Colors are downsampled from 16 million RGB values to an ANSI color format that is supported by the terminal emulator (or by specifying `{level: n}` as a Chalk option). For example, Chalk configured to run at level 1 (basic color support) will downsample an RGB value of #FF0000 (red) to 31 (ANSI escape for red).
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
- `chalk.hex('#DEADED').underline('Hello, world!')`
|
||||||
|
- `chalk.keyword('orange')('Some orange text')`
|
||||||
|
- `chalk.rgb(15, 100, 204).inverse('Hello!')`
|
||||||
|
|
||||||
|
Background versions of these models are prefixed with `bg` and the first level of the module capitalized (e.g. `keyword` for foreground colors and `bgKeyword` for background colors).
|
||||||
|
|
||||||
|
- `chalk.bgHex('#DEADED').underline('Hello, world!')`
|
||||||
|
- `chalk.bgKeyword('orange')('Some orange text')`
|
||||||
|
- `chalk.bgRgb(15, 100, 204).inverse('Hello!')`
|
||||||
|
|
||||||
|
The following color models can be used:
|
||||||
|
|
||||||
|
- [`rgb`](https://en.wikipedia.org/wiki/RGB_color_model) - Example: `chalk.rgb(255, 136, 0).bold('Orange!')`
|
||||||
|
- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')`
|
||||||
|
- [`keyword`](https://www.w3.org/wiki/CSS/Properties/color/keywords) (CSS keywords) - Example: `chalk.keyword('orange').bold('Orange!')`
|
||||||
|
- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')`
|
||||||
|
- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsv(32, 100, 100).bold('Orange!')`
|
||||||
|
- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')`
|
||||||
|
- [`ansi`](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) - Example: `chalk.ansi(31).bgAnsi(93)('red on yellowBright')`
|
||||||
|
- [`ansi256`](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) - Example: `chalk.bgAnsi256(194)('Honeydew, more or less')`
|
||||||
|
|
||||||
|
## Windows
|
||||||
|
|
||||||
|
If you're on Windows, do yourself a favor and use [Windows Terminal](https://github.com/microsoft/terminal) instead of `cmd.exe`.
|
||||||
|
|
||||||
|
## Origin story
|
||||||
|
|
||||||
|
[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.
|
||||||
|
|
||||||
|
## chalk for enterprise
|
||||||
|
|
||||||
|
Available as part of the Tidelift Subscription.
|
||||||
|
|
||||||
|
The maintainers of chalk and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-chalk?utm_source=npm-chalk&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||||
|
|
||||||
|
## Related
|
||||||
|
|
||||||
|
- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
|
||||||
|
- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
|
||||||
|
- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color
|
||||||
|
- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
|
||||||
|
- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Strip ANSI escape codes from a stream
|
||||||
|
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
|
||||||
|
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
|
||||||
|
- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
|
||||||
|
- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
|
||||||
|
- [color-convert](https://github.com/qix-/color-convert) - Converts colors between different models
|
||||||
|
- [chalk-animation](https://github.com/bokub/chalk-animation) - Animate strings in the terminal
|
||||||
|
- [gradient-string](https://github.com/bokub/gradient-string) - Apply color gradients to strings
|
||||||
|
- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
|
||||||
|
- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
|
||||||
|
|
||||||
|
## Maintainers
|
||||||
|
|
||||||
|
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||||
|
- [Josh Junon](https://github.com/qix-)
|
0
mybulma/node_modules/color-support/bin.js
generated
vendored
Normal file → Executable file
0
mybulma/node_modules/color-support/bin.js
generated
vendored
Normal file → Executable file
13
mybulma/node_modules/console-control-strings/LICENSE
generated
vendored
Normal file
13
mybulma/node_modules/console-control-strings/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
Copyright (c) 2014, Rebecca Turner <me@re-becca.org>
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
145
mybulma/node_modules/console-control-strings/README.md
generated
vendored
Normal file
145
mybulma/node_modules/console-control-strings/README.md
generated
vendored
Normal file
|
@ -0,0 +1,145 @@
|
||||||
|
# Console Control Strings
|
||||||
|
|
||||||
|
A library of cross-platform tested terminal/console command strings for
|
||||||
|
doing things like color and cursor positioning. This is a subset of both
|
||||||
|
ansi and vt100. All control codes included work on both Windows & Unix-like
|
||||||
|
OSes, except where noted.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```js
|
||||||
|
var consoleControl = require('console-control-strings')
|
||||||
|
|
||||||
|
console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset'))
|
||||||
|
process.stdout.write(consoleControl.goto(75, 10))
|
||||||
|
```
|
||||||
|
|
||||||
|
## Why Another?
|
||||||
|
|
||||||
|
There are tons of libraries similar to this one. I wanted one that was:
|
||||||
|
|
||||||
|
1. Very clear about compatibility goals.
|
||||||
|
2. Could emit, for instance, a start color code without an end one.
|
||||||
|
3. Returned strings w/o writing to streams.
|
||||||
|
4. Was not weighed down with other unrelated baggage.
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
### var code = consoleControl.up(_num = 1_)
|
||||||
|
|
||||||
|
Returns the escape sequence to move _num_ lines up.
|
||||||
|
|
||||||
|
### var code = consoleControl.down(_num = 1_)
|
||||||
|
|
||||||
|
Returns the escape sequence to move _num_ lines down.
|
||||||
|
|
||||||
|
### var code = consoleControl.forward(_num = 1_)
|
||||||
|
|
||||||
|
Returns the escape sequence to move _num_ lines righ.
|
||||||
|
|
||||||
|
### var code = consoleControl.back(_num = 1_)
|
||||||
|
|
||||||
|
Returns the escape sequence to move _num_ lines left.
|
||||||
|
|
||||||
|
### var code = consoleControl.nextLine(_num = 1_)
|
||||||
|
|
||||||
|
Returns the escape sequence to move _num_ lines down and to the beginning of
|
||||||
|
the line.
|
||||||
|
|
||||||
|
### var code = consoleControl.previousLine(_num = 1_)
|
||||||
|
|
||||||
|
Returns the escape sequence to move _num_ lines up and to the beginning of
|
||||||
|
the line.
|
||||||
|
|
||||||
|
### var code = consoleControl.eraseData()
|
||||||
|
|
||||||
|
Returns the escape sequence to erase everything from the current cursor
|
||||||
|
position to the bottom right of the screen. This is line based, so it
|
||||||
|
erases the remainder of the current line and all following lines.
|
||||||
|
|
||||||
|
### var code = consoleControl.eraseLine()
|
||||||
|
|
||||||
|
Returns the escape sequence to erase to the end of the current line.
|
||||||
|
|
||||||
|
### var code = consoleControl.goto(_x_, _y_)
|
||||||
|
|
||||||
|
Returns the escape sequence to move the cursor to the designated position.
|
||||||
|
Note that the origin is _1, 1_ not _0, 0_.
|
||||||
|
|
||||||
|
### var code = consoleControl.gotoSOL()
|
||||||
|
|
||||||
|
Returns the escape sequence to move the cursor to the beginning of the
|
||||||
|
current line. (That is, it returns a carriage return, `\r`.)
|
||||||
|
|
||||||
|
### var code = consoleControl.beep()
|
||||||
|
|
||||||
|
Returns the escape sequence to cause the termianl to beep. (That is, it
|
||||||
|
returns unicode character `\x0007`, a Control-G.)
|
||||||
|
|
||||||
|
### var code = consoleControl.hideCursor()
|
||||||
|
|
||||||
|
Returns the escape sequence to hide the cursor.
|
||||||
|
|
||||||
|
### var code = consoleControl.showCursor()
|
||||||
|
|
||||||
|
Returns the escape sequence to show the cursor.
|
||||||
|
|
||||||
|
### var code = consoleControl.color(_colors = []_)
|
||||||
|
|
||||||
|
### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_)
|
||||||
|
|
||||||
|
Returns the escape sequence to set the current terminal display attributes
|
||||||
|
(mostly colors). Arguments can either be a list of attributes or an array
|
||||||
|
of attributes. The difference between passing in an array or list of colors
|
||||||
|
and calling `.color` separately for each one, is that in the former case a
|
||||||
|
single escape sequence will be produced where as in the latter each change
|
||||||
|
will have its own distinct escape sequence. Each attribute can be one of:
|
||||||
|
|
||||||
|
* Reset:
|
||||||
|
* **reset** – Reset all attributes to the terminal default.
|
||||||
|
* Styles:
|
||||||
|
* **bold** – Display text as bold. In some terminals this means using a
|
||||||
|
bold font, in others this means changing the color. In some it means
|
||||||
|
both.
|
||||||
|
* **italic** – Display text as italic. This is not available in most Windows terminals.
|
||||||
|
* **underline** – Underline text. This is not available in most Windows Terminals.
|
||||||
|
* **inverse** – Invert the foreground and background colors.
|
||||||
|
* **stopBold** – Do not display text as bold.
|
||||||
|
* **stopItalic** – Do not display text as italic.
|
||||||
|
* **stopUnderline** – Do not underline text.
|
||||||
|
* **stopInverse** – Do not invert foreground and background.
|
||||||
|
* Colors:
|
||||||
|
* **white**
|
||||||
|
* **black**
|
||||||
|
* **blue**
|
||||||
|
* **cyan**
|
||||||
|
* **green**
|
||||||
|
* **magenta**
|
||||||
|
* **red**
|
||||||
|
* **yellow**
|
||||||
|
* **grey** / **brightBlack**
|
||||||
|
* **brightRed**
|
||||||
|
* **brightGreen**
|
||||||
|
* **brightYellow**
|
||||||
|
* **brightBlue**
|
||||||
|
* **brightMagenta**
|
||||||
|
* **brightCyan**
|
||||||
|
* **brightWhite**
|
||||||
|
* Background Colors:
|
||||||
|
* **bgWhite**
|
||||||
|
* **bgBlack**
|
||||||
|
* **bgBlue**
|
||||||
|
* **bgCyan**
|
||||||
|
* **bgGreen**
|
||||||
|
* **bgMagenta**
|
||||||
|
* **bgRed**
|
||||||
|
* **bgYellow**
|
||||||
|
* **bgGrey** / **bgBrightBlack**
|
||||||
|
* **bgBrightRed**
|
||||||
|
* **bgBrightGreen**
|
||||||
|
* **bgBrightYellow**
|
||||||
|
* **bgBrightBlue**
|
||||||
|
* **bgBrightMagenta**
|
||||||
|
* **bgBrightCyan**
|
||||||
|
* **bgBrightWhite**
|
||||||
|
|
140
mybulma/node_modules/console-control-strings/README.md~
generated
vendored
Normal file
140
mybulma/node_modules/console-control-strings/README.md~
generated
vendored
Normal file
|
@ -0,0 +1,140 @@
|
||||||
|
# Console Control Strings
|
||||||
|
|
||||||
|
A library of cross-platform tested terminal/console command strings for
|
||||||
|
doing things like color and cursor positioning. This is a subset of both
|
||||||
|
ansi and vt100. All control codes included work on both Windows & Unix-like
|
||||||
|
OSes, except where noted.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```js
|
||||||
|
var consoleControl = require('console-control-strings')
|
||||||
|
|
||||||
|
console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset'))
|
||||||
|
process.stdout.write(consoleControl.goto(75, 10))
|
||||||
|
```
|
||||||
|
|
||||||
|
## Why Another?
|
||||||
|
|
||||||
|
There are tons of libraries similar to this one. I wanted one that was:
|
||||||
|
|
||||||
|
1. Very clear about compatibility goals.
|
||||||
|
2. Could emit, for instance, a start color code without an end one.
|
||||||
|
3. Returned strings w/o writing to streams.
|
||||||
|
4. Was not weighed down with other unrelated baggage.
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
### var code = consoleControl.up(_num = 1_)
|
||||||
|
|
||||||
|
Returns the escape sequence to move _num_ lines up.
|
||||||
|
|
||||||
|
### var code = consoleControl.down(_num = 1_)
|
||||||
|
|
||||||
|
Returns the escape sequence to move _num_ lines down.
|
||||||
|
|
||||||
|
### var code = consoleControl.forward(_num = 1_)
|
||||||
|
|
||||||
|
Returns the escape sequence to move _num_ lines righ.
|
||||||
|
|
||||||
|
### var code = consoleControl.back(_num = 1_)
|
||||||
|
|
||||||
|
Returns the escape sequence to move _num_ lines left.
|
||||||
|
|
||||||
|
### var code = consoleControl.nextLine(_num = 1_)
|
||||||
|
|
||||||
|
Returns the escape sequence to move _num_ lines down and to the beginning of
|
||||||
|
the line.
|
||||||
|
|
||||||
|
### var code = consoleControl.previousLine(_num = 1_)
|
||||||
|
|
||||||
|
Returns the escape sequence to move _num_ lines up and to the beginning of
|
||||||
|
the line.
|
||||||
|
|
||||||
|
### var code = consoleControl.eraseData()
|
||||||
|
|
||||||
|
Returns the escape sequence to erase everything from the current cursor
|
||||||
|
position to the bottom right of the screen. This is line based, so it
|
||||||
|
erases the remainder of the current line and all following lines.
|
||||||
|
|
||||||
|
### var code = consoleControl.eraseLine()
|
||||||
|
|
||||||
|
Returns the escape sequence to erase to the end of the current line.
|
||||||
|
|
||||||
|
### var code = consoleControl.goto(_x_, _y_)
|
||||||
|
|
||||||
|
Returns the escape sequence to move the cursor to the designated position.
|
||||||
|
Note that the origin is _1, 1_ not _0, 0_.
|
||||||
|
|
||||||
|
### var code = consoleControl.gotoSOL()
|
||||||
|
|
||||||
|
Returns the escape sequence to move the cursor to the beginning of the
|
||||||
|
current line. (That is, it returns a carriage return, `\r`.)
|
||||||
|
|
||||||
|
### var code = consoleControl.hideCursor()
|
||||||
|
|
||||||
|
Returns the escape sequence to hide the cursor.
|
||||||
|
|
||||||
|
### var code = consoleControl.showCursor()
|
||||||
|
|
||||||
|
Returns the escape sequence to show the cursor.
|
||||||
|
|
||||||
|
### var code = consoleControl.color(_colors = []_)
|
||||||
|
|
||||||
|
### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_)
|
||||||
|
|
||||||
|
Returns the escape sequence to set the current terminal display attributes
|
||||||
|
(mostly colors). Arguments can either be a list of attributes or an array
|
||||||
|
of attributes. The difference between passing in an array or list of colors
|
||||||
|
and calling `.color` separately for each one, is that in the former case a
|
||||||
|
single escape sequence will be produced where as in the latter each change
|
||||||
|
will have its own distinct escape sequence. Each attribute can be one of:
|
||||||
|
|
||||||
|
* Reset:
|
||||||
|
* **reset** – Reset all attributes to the terminal default.
|
||||||
|
* Styles:
|
||||||
|
* **bold** – Display text as bold. In some terminals this means using a
|
||||||
|
bold font, in others this means changing the color. In some it means
|
||||||
|
both.
|
||||||
|
* **italic** – Display text as italic. This is not available in most Windows terminals.
|
||||||
|
* **underline** – Underline text. This is not available in most Windows Terminals.
|
||||||
|
* **inverse** – Invert the foreground and background colors.
|
||||||
|
* **stopBold** – Do not display text as bold.
|
||||||
|
* **stopItalic** – Do not display text as italic.
|
||||||
|
* **stopUnderline** – Do not underline text.
|
||||||
|
* **stopInverse** – Do not invert foreground and background.
|
||||||
|
* Colors:
|
||||||
|
* **white**
|
||||||
|
* **black**
|
||||||
|
* **blue**
|
||||||
|
* **cyan**
|
||||||
|
* **green**
|
||||||
|
* **magenta**
|
||||||
|
* **red**
|
||||||
|
* **yellow**
|
||||||
|
* **grey** / **brightBlack**
|
||||||
|
* **brightRed**
|
||||||
|
* **brightGreen**
|
||||||
|
* **brightYellow**
|
||||||
|
* **brightBlue**
|
||||||
|
* **brightMagenta**
|
||||||
|
* **brightCyan**
|
||||||
|
* **brightWhite**
|
||||||
|
* Background Colors:
|
||||||
|
* **bgWhite**
|
||||||
|
* **bgBlack**
|
||||||
|
* **bgBlue**
|
||||||
|
* **bgCyan**
|
||||||
|
* **bgGreen**
|
||||||
|
* **bgMagenta**
|
||||||
|
* **bgRed**
|
||||||
|
* **bgYellow**
|
||||||
|
* **bgGrey** / **bgBrightBlack**
|
||||||
|
* **bgBrightRed**
|
||||||
|
* **bgBrightGreen**
|
||||||
|
* **bgBrightYellow**
|
||||||
|
* **bgBrightBlue**
|
||||||
|
* **bgBrightMagenta**
|
||||||
|
* **bgBrightCyan**
|
||||||
|
* **bgBrightWhite**
|
||||||
|
|
125
mybulma/node_modules/console-control-strings/index.js
generated
vendored
Normal file
125
mybulma/node_modules/console-control-strings/index.js
generated
vendored
Normal file
|
@ -0,0 +1,125 @@
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
// These tables borrowed from `ansi`
|
||||||
|
|
||||||
|
var prefix = '\x1b['
|
||||||
|
|
||||||
|
exports.up = function up (num) {
|
||||||
|
return prefix + (num || '') + 'A'
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.down = function down (num) {
|
||||||
|
return prefix + (num || '') + 'B'
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.forward = function forward (num) {
|
||||||
|
return prefix + (num || '') + 'C'
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.back = function back (num) {
|
||||||
|
return prefix + (num || '') + 'D'
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.nextLine = function nextLine (num) {
|
||||||
|
return prefix + (num || '') + 'E'
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.previousLine = function previousLine (num) {
|
||||||
|
return prefix + (num || '') + 'F'
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.horizontalAbsolute = function horizontalAbsolute (num) {
|
||||||
|
if (num == null) throw new Error('horizontalAboslute requires a column to position to')
|
||||||
|
return prefix + num + 'G'
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.eraseData = function eraseData () {
|
||||||
|
return prefix + 'J'
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.eraseLine = function eraseLine () {
|
||||||
|
return prefix + 'K'
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.goto = function (x, y) {
|
||||||
|
return prefix + y + ';' + x + 'H'
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.gotoSOL = function () {
|
||||||
|
return '\r'
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.beep = function () {
|
||||||
|
return '\x07'
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.hideCursor = function hideCursor () {
|
||||||
|
return prefix + '?25l'
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.showCursor = function showCursor () {
|
||||||
|
return prefix + '?25h'
|
||||||
|
}
|
||||||
|
|
||||||
|
var colors = {
|
||||||
|
reset: 0,
|
||||||
|
// styles
|
||||||
|
bold: 1,
|
||||||
|
italic: 3,
|
||||||
|
underline: 4,
|
||||||
|
inverse: 7,
|
||||||
|
// resets
|
||||||
|
stopBold: 22,
|
||||||
|
stopItalic: 23,
|
||||||
|
stopUnderline: 24,
|
||||||
|
stopInverse: 27,
|
||||||
|
// colors
|
||||||
|
white: 37,
|
||||||
|
black: 30,
|
||||||
|
blue: 34,
|
||||||
|
cyan: 36,
|
||||||
|
green: 32,
|
||||||
|
magenta: 35,
|
||||||
|
red: 31,
|
||||||
|
yellow: 33,
|
||||||
|
bgWhite: 47,
|
||||||
|
bgBlack: 40,
|
||||||
|
bgBlue: 44,
|
||||||
|
bgCyan: 46,
|
||||||
|
bgGreen: 42,
|
||||||
|
bgMagenta: 45,
|
||||||
|
bgRed: 41,
|
||||||
|
bgYellow: 43,
|
||||||
|
|
||||||
|
grey: 90,
|
||||||
|
brightBlack: 90,
|
||||||
|
brightRed: 91,
|
||||||
|
brightGreen: 92,
|
||||||
|
brightYellow: 93,
|
||||||
|
brightBlue: 94,
|
||||||
|
brightMagenta: 95,
|
||||||
|
brightCyan: 96,
|
||||||
|
brightWhite: 97,
|
||||||
|
|
||||||
|
bgGrey: 100,
|
||||||
|
bgBrightBlack: 100,
|
||||||
|
bgBrightRed: 101,
|
||||||
|
bgBrightGreen: 102,
|
||||||
|
bgBrightYellow: 103,
|
||||||
|
bgBrightBlue: 104,
|
||||||
|
bgBrightMagenta: 105,
|
||||||
|
bgBrightCyan: 106,
|
||||||
|
bgBrightWhite: 107
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.color = function color (colorWith) {
|
||||||
|
if (arguments.length !== 1 || !Array.isArray(colorWith)) {
|
||||||
|
colorWith = Array.prototype.slice.call(arguments)
|
||||||
|
}
|
||||||
|
return prefix + colorWith.map(colorNameToCode).join(';') + 'm'
|
||||||
|
}
|
||||||
|
|
||||||
|
function colorNameToCode (color) {
|
||||||
|
if (colors[color] != null) return colors[color]
|
||||||
|
throw new Error('Unknown color or style name: ' + color)
|
||||||
|
}
|
27
mybulma/node_modules/console-control-strings/package.json
generated
vendored
Normal file
27
mybulma/node_modules/console-control-strings/package.json
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"name": "console-control-strings",
|
||||||
|
"version": "1.1.0",
|
||||||
|
"description": "A library of cross-platform tested terminal/console command strings for doing things like color and cursor positioning. This is a subset of both ansi and vt100. All control codes included work on both Windows & Unix-like OSes, except where noted.",
|
||||||
|
"main": "index.js",
|
||||||
|
"directories": {
|
||||||
|
"test": "test"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "standard && tap test/*.js"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/iarna/console-control-strings"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "Rebecca Turner <me@re-becca.org> (http://re-becca.org/)",
|
||||||
|
"license": "ISC",
|
||||||
|
"files": [
|
||||||
|
"LICENSE",
|
||||||
|
"index.js"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"standard": "^7.1.2",
|
||||||
|
"tap": "^5.7.2"
|
||||||
|
}
|
||||||
|
}
|
19
mybulma/node_modules/core-util-is/LICENSE
generated
vendored
Normal file
19
mybulma/node_modules/core-util-is/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
Copyright Node.js contributors. All rights reserved.
|
||||||
|
|
||||||
|
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.
|
3
mybulma/node_modules/core-util-is/README.md
generated
vendored
Normal file
3
mybulma/node_modules/core-util-is/README.md
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# core-util-is
|
||||||
|
|
||||||
|
The `util.is*` functions introduced in Node v0.12.
|
38
mybulma/node_modules/core-util-is/package.json
generated
vendored
Normal file
38
mybulma/node_modules/core-util-is/package.json
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"name": "core-util-is",
|
||||||
|
"version": "1.0.3",
|
||||||
|
"description": "The `util.is*` functions introduced in Node v0.12.",
|
||||||
|
"main": "lib/util.js",
|
||||||
|
"files": [
|
||||||
|
"lib"
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/isaacs/core-util-is"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"util",
|
||||||
|
"isBuffer",
|
||||||
|
"isArray",
|
||||||
|
"isNumber",
|
||||||
|
"isString",
|
||||||
|
"isRegExp",
|
||||||
|
"isThis",
|
||||||
|
"isThat",
|
||||||
|
"polyfill"
|
||||||
|
],
|
||||||
|
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/isaacs/core-util-is/issues"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "tap test.js",
|
||||||
|
"preversion": "npm test",
|
||||||
|
"postversion": "npm publish",
|
||||||
|
"prepublishOnly": "git push origin --follow-tags"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"tap": "^15.0.9"
|
||||||
|
}
|
||||||
|
}
|
13
mybulma/node_modules/decamelize/index.js
generated
vendored
Normal file
13
mybulma/node_modules/decamelize/index.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
'use strict';
|
||||||
|
module.exports = function (str, sep) {
|
||||||
|
if (typeof str !== 'string') {
|
||||||
|
throw new TypeError('Expected a string');
|
||||||
|
}
|
||||||
|
|
||||||
|
sep = typeof sep === 'undefined' ? '_' : sep;
|
||||||
|
|
||||||
|
return str
|
||||||
|
.replace(/([a-z\d])([A-Z])/g, '$1' + sep + '$2')
|
||||||
|
.replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + sep + '$2')
|
||||||
|
.toLowerCase();
|
||||||
|
};
|
21
mybulma/node_modules/decamelize/license
generated
vendored
Normal file
21
mybulma/node_modules/decamelize/license
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||||
|
|
||||||
|
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.
|
38
mybulma/node_modules/decamelize/package.json
generated
vendored
Normal file
38
mybulma/node_modules/decamelize/package.json
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"name": "decamelize",
|
||||||
|
"version": "1.2.0",
|
||||||
|
"description": "Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow",
|
||||||
|
"license": "MIT",
|
||||||
|
"repository": "sindresorhus/decamelize",
|
||||||
|
"author": {
|
||||||
|
"name": "Sindre Sorhus",
|
||||||
|
"email": "sindresorhus@gmail.com",
|
||||||
|
"url": "sindresorhus.com"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "xo && ava"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"index.js"
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
"decamelize",
|
||||||
|
"decamelcase",
|
||||||
|
"camelcase",
|
||||||
|
"lowercase",
|
||||||
|
"case",
|
||||||
|
"dash",
|
||||||
|
"hyphen",
|
||||||
|
"string",
|
||||||
|
"str",
|
||||||
|
"text",
|
||||||
|
"convert"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"ava": "*",
|
||||||
|
"xo": "*"
|
||||||
|
}
|
||||||
|
}
|
48
mybulma/node_modules/decamelize/readme.md
generated
vendored
Normal file
48
mybulma/node_modules/decamelize/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
# decamelize [![Build Status](https://travis-ci.org/sindresorhus/decamelize.svg?branch=master)](https://travis-ci.org/sindresorhus/decamelize)
|
||||||
|
|
||||||
|
> Convert a camelized string into a lowercased one with a custom separator<br>
|
||||||
|
> Example: `unicornRainbow` → `unicorn_rainbow`
|
||||||
|
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```
|
||||||
|
$ npm install --save decamelize
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```js
|
||||||
|
const decamelize = require('decamelize');
|
||||||
|
|
||||||
|
decamelize('unicornRainbow');
|
||||||
|
//=> 'unicorn_rainbow'
|
||||||
|
|
||||||
|
decamelize('unicornRainbow', '-');
|
||||||
|
//=> 'unicorn-rainbow'
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
### decamelize(input, [separator])
|
||||||
|
|
||||||
|
#### input
|
||||||
|
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
#### separator
|
||||||
|
|
||||||
|
Type: `string`<br>
|
||||||
|
Default: `_`
|
||||||
|
|
||||||
|
|
||||||
|
## Related
|
||||||
|
|
||||||
|
See [`camelcase`](https://github.com/sindresorhus/camelcase) for the inverse.
|
||||||
|
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
1
mybulma/node_modules/delegates/.npmignore
generated
vendored
Normal file
1
mybulma/node_modules/delegates/.npmignore
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
node_modules/
|
22
mybulma/node_modules/delegates/History.md
generated
vendored
Normal file
22
mybulma/node_modules/delegates/History.md
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
|
||||||
|
1.0.0 / 2015-12-14
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Merge pull request #12 from kasicka/master
|
||||||
|
* Add license text
|
||||||
|
|
||||||
|
0.1.0 / 2014-10-17
|
||||||
|
==================
|
||||||
|
|
||||||
|
* adds `.fluent()` to api
|
||||||
|
|
||||||
|
0.0.3 / 2014-01-13
|
||||||
|
==================
|
||||||
|
|
||||||
|
* fix receiver for .method()
|
||||||
|
|
||||||
|
0.0.2 / 2014-01-13
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Object.defineProperty() sucks
|
||||||
|
* Initial commit
|
20
mybulma/node_modules/delegates/License
generated
vendored
Normal file
20
mybulma/node_modules/delegates/License
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
Copyright (c) 2015 TJ Holowaychuk <tj@vision-media.ca>
|
||||||
|
|
||||||
|
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.
|
8
mybulma/node_modules/delegates/Makefile
generated
vendored
Normal file
8
mybulma/node_modules/delegates/Makefile
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
|
||||||
|
test:
|
||||||
|
@./node_modules/.bin/mocha \
|
||||||
|
--require should \
|
||||||
|
--reporter spec \
|
||||||
|
--bail
|
||||||
|
|
||||||
|
.PHONY: test
|
94
mybulma/node_modules/delegates/Readme.md
generated
vendored
Normal file
94
mybulma/node_modules/delegates/Readme.md
generated
vendored
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
|
||||||
|
# delegates
|
||||||
|
|
||||||
|
Node method and accessor delegation utilty.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```
|
||||||
|
$ npm install delegates
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```js
|
||||||
|
var delegate = require('delegates');
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
delegate(proto, 'request')
|
||||||
|
.method('acceptsLanguages')
|
||||||
|
.method('acceptsEncodings')
|
||||||
|
.method('acceptsCharsets')
|
||||||
|
.method('accepts')
|
||||||
|
.method('is')
|
||||||
|
.access('querystring')
|
||||||
|
.access('idempotent')
|
||||||
|
.access('socket')
|
||||||
|
.access('length')
|
||||||
|
.access('query')
|
||||||
|
.access('search')
|
||||||
|
.access('status')
|
||||||
|
.access('method')
|
||||||
|
.access('path')
|
||||||
|
.access('body')
|
||||||
|
.access('host')
|
||||||
|
.access('url')
|
||||||
|
.getter('subdomains')
|
||||||
|
.getter('protocol')
|
||||||
|
.getter('header')
|
||||||
|
.getter('stale')
|
||||||
|
.getter('fresh')
|
||||||
|
.getter('secure')
|
||||||
|
.getter('ips')
|
||||||
|
.getter('ip')
|
||||||
|
```
|
||||||
|
|
||||||
|
# API
|
||||||
|
|
||||||
|
## Delegate(proto, prop)
|
||||||
|
|
||||||
|
Creates a delegator instance used to configure using the `prop` on the given
|
||||||
|
`proto` object. (which is usually a prototype)
|
||||||
|
|
||||||
|
## Delegate#method(name)
|
||||||
|
|
||||||
|
Allows the given method `name` to be accessed on the host.
|
||||||
|
|
||||||
|
## Delegate#getter(name)
|
||||||
|
|
||||||
|
Creates a "getter" for the property with the given `name` on the delegated
|
||||||
|
object.
|
||||||
|
|
||||||
|
## Delegate#setter(name)
|
||||||
|
|
||||||
|
Creates a "setter" for the property with the given `name` on the delegated
|
||||||
|
object.
|
||||||
|
|
||||||
|
## Delegate#access(name)
|
||||||
|
|
||||||
|
Creates an "accessor" (ie: both getter *and* setter) for the property with the
|
||||||
|
given `name` on the delegated object.
|
||||||
|
|
||||||
|
## Delegate#fluent(name)
|
||||||
|
|
||||||
|
A unique type of "accessor" that works for a "fluent" API. When called as a
|
||||||
|
getter, the method returns the expected value. However, if the method is called
|
||||||
|
with a value, it will return itself so it can be chained. For example:
|
||||||
|
|
||||||
|
```js
|
||||||
|
delegate(proto, 'request')
|
||||||
|
.fluent('query')
|
||||||
|
|
||||||
|
// getter
|
||||||
|
var q = request.query();
|
||||||
|
|
||||||
|
// setter (chainable)
|
||||||
|
request
|
||||||
|
.query({ a: 1 })
|
||||||
|
.query({ b: 2 });
|
||||||
|
```
|
||||||
|
|
||||||
|
# License
|
||||||
|
|
||||||
|
MIT
|
121
mybulma/node_modules/delegates/index.js
generated
vendored
Normal file
121
mybulma/node_modules/delegates/index.js
generated
vendored
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Expose `Delegator`.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = Delegator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize a delegator.
|
||||||
|
*
|
||||||
|
* @param {Object} proto
|
||||||
|
* @param {String} target
|
||||||
|
* @api public
|
||||||
|
*/
|
||||||
|
|
||||||
|
function Delegator(proto, target) {
|
||||||
|
if (!(this instanceof Delegator)) return new Delegator(proto, target);
|
||||||
|
this.proto = proto;
|
||||||
|
this.target = target;
|
||||||
|
this.methods = [];
|
||||||
|
this.getters = [];
|
||||||
|
this.setters = [];
|
||||||
|
this.fluents = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delegate method `name`.
|
||||||
|
*
|
||||||
|
* @param {String} name
|
||||||
|
* @return {Delegator} self
|
||||||
|
* @api public
|
||||||
|
*/
|
||||||
|
|
||||||
|
Delegator.prototype.method = function(name){
|
||||||
|
var proto = this.proto;
|
||||||
|
var target = this.target;
|
||||||
|
this.methods.push(name);
|
||||||
|
|
||||||
|
proto[name] = function(){
|
||||||
|
return this[target][name].apply(this[target], arguments);
|
||||||
|
};
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delegator accessor `name`.
|
||||||
|
*
|
||||||
|
* @param {String} name
|
||||||
|
* @return {Delegator} self
|
||||||
|
* @api public
|
||||||
|
*/
|
||||||
|
|
||||||
|
Delegator.prototype.access = function(name){
|
||||||
|
return this.getter(name).setter(name);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delegator getter `name`.
|
||||||
|
*
|
||||||
|
* @param {String} name
|
||||||
|
* @return {Delegator} self
|
||||||
|
* @api public
|
||||||
|
*/
|
||||||
|
|
||||||
|
Delegator.prototype.getter = function(name){
|
||||||
|
var proto = this.proto;
|
||||||
|
var target = this.target;
|
||||||
|
this.getters.push(name);
|
||||||
|
|
||||||
|
proto.__defineGetter__(name, function(){
|
||||||
|
return this[target][name];
|
||||||
|
});
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delegator setter `name`.
|
||||||
|
*
|
||||||
|
* @param {String} name
|
||||||
|
* @return {Delegator} self
|
||||||
|
* @api public
|
||||||
|
*/
|
||||||
|
|
||||||
|
Delegator.prototype.setter = function(name){
|
||||||
|
var proto = this.proto;
|
||||||
|
var target = this.target;
|
||||||
|
this.setters.push(name);
|
||||||
|
|
||||||
|
proto.__defineSetter__(name, function(val){
|
||||||
|
return this[target][name] = val;
|
||||||
|
});
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delegator fluent accessor
|
||||||
|
*
|
||||||
|
* @param {String} name
|
||||||
|
* @return {Delegator} self
|
||||||
|
* @api public
|
||||||
|
*/
|
||||||
|
|
||||||
|
Delegator.prototype.fluent = function (name) {
|
||||||
|
var proto = this.proto;
|
||||||
|
var target = this.target;
|
||||||
|
this.fluents.push(name);
|
||||||
|
|
||||||
|
proto[name] = function(val){
|
||||||
|
if ('undefined' != typeof val) {
|
||||||
|
this[target][name] = val;
|
||||||
|
return this;
|
||||||
|
} else {
|
||||||
|
return this[target][name];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
13
mybulma/node_modules/delegates/package.json
generated
vendored
Normal file
13
mybulma/node_modules/delegates/package.json
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"name": "delegates",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"repository": "visionmedia/node-delegates",
|
||||||
|
"description": "delegate methods and accessors to another property",
|
||||||
|
"keywords": ["delegate", "delegation"],
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"mocha": "*",
|
||||||
|
"should": "*"
|
||||||
|
},
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
20
mybulma/node_modules/emoji-regex/LICENSE-MIT.txt
generated
vendored
Normal file
20
mybulma/node_modules/emoji-regex/LICENSE-MIT.txt
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
Copyright Mathias Bynens <https://mathiasbynens.be/>
|
||||||
|
|
||||||
|
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.
|
73
mybulma/node_modules/emoji-regex/README.md
generated
vendored
Normal file
73
mybulma/node_modules/emoji-regex/README.md
generated
vendored
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
# emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=master)](https://travis-ci.org/mathiasbynens/emoji-regex)
|
||||||
|
|
||||||
|
_emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard.
|
||||||
|
|
||||||
|
This repository contains a script that generates this regular expression based on [the data from Unicode v12](https://github.com/mathiasbynens/unicode-12.0.0). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Via [npm](https://www.npmjs.com/):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install emoji-regex
|
||||||
|
```
|
||||||
|
|
||||||
|
In [Node.js](https://nodejs.org/):
|
||||||
|
|
||||||
|
```js
|
||||||
|
const emojiRegex = require('emoji-regex');
|
||||||
|
// Note: because the regular expression has the global flag set, this module
|
||||||
|
// exports a function that returns the regex rather than exporting the regular
|
||||||
|
// expression itself, to make it impossible to (accidentally) mutate the
|
||||||
|
// original regular expression.
|
||||||
|
|
||||||
|
const text = `
|
||||||
|
\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation)
|
||||||
|
\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji
|
||||||
|
\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base)
|
||||||
|
\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier
|
||||||
|
`;
|
||||||
|
|
||||||
|
const regex = emojiRegex();
|
||||||
|
let match;
|
||||||
|
while (match = regex.exec(text)) {
|
||||||
|
const emoji = match[0];
|
||||||
|
console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Console output:
|
||||||
|
|
||||||
|
```
|
||||||
|
Matched sequence ⌚ — code points: 1
|
||||||
|
Matched sequence ⌚ — code points: 1
|
||||||
|
Matched sequence ↔️ — code points: 2
|
||||||
|
Matched sequence ↔️ — code points: 2
|
||||||
|
Matched sequence 👩 — code points: 1
|
||||||
|
Matched sequence 👩 — code points: 1
|
||||||
|
Matched sequence 👩🏿 — code points: 2
|
||||||
|
Matched sequence 👩🏿 — code points: 2
|
||||||
|
```
|
||||||
|
|
||||||
|
To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const emojiRegex = require('emoji-regex/text.js');
|
||||||
|
```
|
||||||
|
|
||||||
|
Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const emojiRegex = require('emoji-regex/es2015/index.js');
|
||||||
|
const emojiRegexText = require('emoji-regex/es2015/text.js');
|
||||||
|
```
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||||
|
|---|
|
||||||
|
| [Mathias Bynens](https://mathiasbynens.be/) |
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
_emoji-regex_ is available under the [MIT](https://mths.be/mit) license.
|
23
mybulma/node_modules/emoji-regex/index.d.ts
generated
vendored
Normal file
23
mybulma/node_modules/emoji-regex/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
declare module 'emoji-regex' {
|
||||||
|
function emojiRegex(): RegExp;
|
||||||
|
|
||||||
|
export default emojiRegex;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module 'emoji-regex/text' {
|
||||||
|
function emojiRegex(): RegExp;
|
||||||
|
|
||||||
|
export default emojiRegex;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module 'emoji-regex/es2015' {
|
||||||
|
function emojiRegex(): RegExp;
|
||||||
|
|
||||||
|
export default emojiRegex;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module 'emoji-regex/es2015/text' {
|
||||||
|
function emojiRegex(): RegExp;
|
||||||
|
|
||||||
|
export default emojiRegex;
|
||||||
|
}
|
6
mybulma/node_modules/emoji-regex/index.js
generated
vendored
Normal file
6
mybulma/node_modules/emoji-regex/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
50
mybulma/node_modules/emoji-regex/package.json
generated
vendored
Normal file
50
mybulma/node_modules/emoji-regex/package.json
generated
vendored
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
{
|
||||||
|
"name": "emoji-regex",
|
||||||
|
"version": "8.0.0",
|
||||||
|
"description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.",
|
||||||
|
"homepage": "https://mths.be/emoji-regex",
|
||||||
|
"main": "index.js",
|
||||||
|
"types": "index.d.ts",
|
||||||
|
"keywords": [
|
||||||
|
"unicode",
|
||||||
|
"regex",
|
||||||
|
"regexp",
|
||||||
|
"regular expressions",
|
||||||
|
"code points",
|
||||||
|
"symbols",
|
||||||
|
"characters",
|
||||||
|
"emoji"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"author": {
|
||||||
|
"name": "Mathias Bynens",
|
||||||
|
"url": "https://mathiasbynens.be/"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/mathiasbynens/emoji-regex.git"
|
||||||
|
},
|
||||||
|
"bugs": "https://github.com/mathiasbynens/emoji-regex/issues",
|
||||||
|
"files": [
|
||||||
|
"LICENSE-MIT.txt",
|
||||||
|
"index.js",
|
||||||
|
"index.d.ts",
|
||||||
|
"text.js",
|
||||||
|
"es2015/index.js",
|
||||||
|
"es2015/text.js"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js",
|
||||||
|
"test": "mocha",
|
||||||
|
"test:watch": "npm run test -- --watch"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/cli": "^7.2.3",
|
||||||
|
"@babel/core": "^7.3.4",
|
||||||
|
"@babel/plugin-proposal-unicode-property-regex": "^7.2.0",
|
||||||
|
"@babel/preset-env": "^7.3.4",
|
||||||
|
"mocha": "^6.0.2",
|
||||||
|
"regexgen": "^1.3.0",
|
||||||
|
"unicode-12.0.0": "^0.7.9"
|
||||||
|
}
|
||||||
|
}
|
6
mybulma/node_modules/emoji-regex/text.js
generated
vendored
Normal file
6
mybulma/node_modules/emoji-regex/text.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
8
mybulma/node_modules/encoding/.prettierrc.js
generated
vendored
Normal file
8
mybulma/node_modules/encoding/.prettierrc.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
module.exports = {
|
||||||
|
printWidth: 160,
|
||||||
|
tabWidth: 4,
|
||||||
|
singleQuote: true,
|
||||||
|
endOfLine: 'lf',
|
||||||
|
trailingComma: 'none',
|
||||||
|
arrowParens: 'avoid'
|
||||||
|
};
|
25
mybulma/node_modules/encoding/.travis.yml
generated
vendored
Normal file
25
mybulma/node_modules/encoding/.travis.yml
generated
vendored
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
language: node_js
|
||||||
|
sudo: false
|
||||||
|
node_js:
|
||||||
|
- "0.10"
|
||||||
|
- 0.12
|
||||||
|
- iojs
|
||||||
|
- 4
|
||||||
|
- 5
|
||||||
|
env:
|
||||||
|
- CXX=g++-4.8
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- g++-4.8
|
||||||
|
notifications:
|
||||||
|
email:
|
||||||
|
- andris@kreata.ee
|
||||||
|
webhooks:
|
||||||
|
urls:
|
||||||
|
- https://webhooks.gitter.im/e/0ed18fd9b3e529b3c2cc
|
||||||
|
on_success: change # options: [always|never|change] default: always
|
||||||
|
on_failure: always # options: [always|never|change] default: always
|
||||||
|
on_start: false # default: false
|
16
mybulma/node_modules/encoding/LICENSE
generated
vendored
Normal file
16
mybulma/node_modules/encoding/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
Copyright (c) 2012-2014 Andris Reinman
|
||||||
|
|
||||||
|
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 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.
|
41
mybulma/node_modules/encoding/README.md
generated
vendored
Normal file
41
mybulma/node_modules/encoding/README.md
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
# Encoding
|
||||||
|
|
||||||
|
**encoding** is a simple wrapper around [iconv-lite](https://github.com/ashtuchkin/iconv-lite/) to convert strings from one encoding to another.
|
||||||
|
|
||||||
|
[![Build Status](https://secure.travis-ci.org/andris9/encoding.svg)](http://travis-ci.org/andris9/Nodemailer)
|
||||||
|
[![npm version](https://badge.fury.io/js/encoding.svg)](http://badge.fury.io/js/encoding)
|
||||||
|
|
||||||
|
Initially _encoding_ was a wrapper around _node-iconv_ (main) and _iconv-lite_ (fallback) and was used as the encoding layer for Nodemailer/mailparser. Somehow it also ended up as a dependency for a bunch of other project, none of these actually using _node-iconv_. The loading mechanics caused issues for front-end projects and Nodemailer/malparser had moved on, so _node-iconv_ was removed.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
Install through npm
|
||||||
|
|
||||||
|
npm install encoding
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Require the module
|
||||||
|
|
||||||
|
var encoding = require("encoding");
|
||||||
|
|
||||||
|
Convert with encoding.convert()
|
||||||
|
|
||||||
|
var resultBuffer = encoding.convert(text, toCharset, fromCharset);
|
||||||
|
|
||||||
|
Where
|
||||||
|
|
||||||
|
- **text** is either a Buffer or a String to be converted
|
||||||
|
- **toCharset** is the characterset to convert the string
|
||||||
|
- **fromCharset** (_optional_, defaults to UTF-8) is the source charset
|
||||||
|
|
||||||
|
Output of the conversion is always a Buffer object.
|
||||||
|
|
||||||
|
Example
|
||||||
|
|
||||||
|
var result = encoding.convert("ÕÄÖÜ", "Latin_1");
|
||||||
|
console.log(result); //<Buffer d5 c4 d6 dc>
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
**MIT**
|
18
mybulma/node_modules/encoding/package.json
generated
vendored
Normal file
18
mybulma/node_modules/encoding/package.json
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"name": "encoding",
|
||||||
|
"version": "0.1.13",
|
||||||
|
"description": "Convert encodings, uses iconv-lite",
|
||||||
|
"main": "lib/encoding.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "nodeunit test"
|
||||||
|
},
|
||||||
|
"repository": "https://github.com/andris9/encoding.git",
|
||||||
|
"author": "Andris Reinman",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"iconv-lite": "^0.6.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"nodeunit": "0.11.3"
|
||||||
|
}
|
||||||
|
}
|
3
mybulma/node_modules/escalade/index.d.ts
generated
vendored
Normal file
3
mybulma/node_modules/escalade/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
type Promisable<T> = T | Promise<T>;
|
||||||
|
export type Callback = (directory: string, files: string[]) => Promisable<string | false | void>;
|
||||||
|
export default function (directory: string, callback: Callback): Promise<string | void>;
|
9
mybulma/node_modules/escalade/license
generated
vendored
Normal file
9
mybulma/node_modules/escalade/license
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
||||||
|
|
||||||
|
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.
|
61
mybulma/node_modules/escalade/package.json
generated
vendored
Normal file
61
mybulma/node_modules/escalade/package.json
generated
vendored
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
{
|
||||||
|
"name": "escalade",
|
||||||
|
"version": "3.1.1",
|
||||||
|
"repository": "lukeed/escalade",
|
||||||
|
"description": "A tiny (183B to 210B) and fast utility to ascend parent directories",
|
||||||
|
"module": "dist/index.mjs",
|
||||||
|
"main": "dist/index.js",
|
||||||
|
"types": "index.d.ts",
|
||||||
|
"license": "MIT",
|
||||||
|
"author": {
|
||||||
|
"name": "Luke Edwards",
|
||||||
|
"email": "luke.edwards05@gmail.com",
|
||||||
|
"url": "https://lukeed.com"
|
||||||
|
},
|
||||||
|
"exports": {
|
||||||
|
".": [
|
||||||
|
{
|
||||||
|
"import": "./dist/index.mjs",
|
||||||
|
"require": "./dist/index.js"
|
||||||
|
},
|
||||||
|
"./dist/index.js"
|
||||||
|
],
|
||||||
|
"./sync": [
|
||||||
|
{
|
||||||
|
"import": "./sync/index.mjs",
|
||||||
|
"require": "./sync/index.js"
|
||||||
|
},
|
||||||
|
"./sync/index.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"*.d.ts",
|
||||||
|
"dist",
|
||||||
|
"sync"
|
||||||
|
],
|
||||||
|
"modes": {
|
||||||
|
"sync": "src/sync.js",
|
||||||
|
"default": "src/async.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "bundt",
|
||||||
|
"pretest": "npm run build",
|
||||||
|
"test": "uvu -r esm test -i fixtures"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"find",
|
||||||
|
"parent",
|
||||||
|
"parents",
|
||||||
|
"directory",
|
||||||
|
"search",
|
||||||
|
"walk"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"bundt": "1.1.1",
|
||||||
|
"esm": "3.2.25",
|
||||||
|
"uvu": "0.3.3"
|
||||||
|
}
|
||||||
|
}
|
211
mybulma/node_modules/escalade/readme.md
generated
vendored
Normal file
211
mybulma/node_modules/escalade/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,211 @@
|
||||||
|
# escalade [![CI](https://github.com/lukeed/escalade/workflows/CI/badge.svg)](https://github.com/lukeed/escalade/actions) [![codecov](https://badgen.now.sh/codecov/c/github/lukeed/escalade)](https://codecov.io/gh/lukeed/escalade)
|
||||||
|
|
||||||
|
> A tiny (183B to 210B) and [fast](#benchmarks) utility to ascend parent directories
|
||||||
|
|
||||||
|
With [escalade](https://en.wikipedia.org/wiki/Escalade), you can scale parent directories until you've found what you're looking for.<br>Given an input file or directory, `escalade` will continue executing your callback function until either:
|
||||||
|
|
||||||
|
1) the callback returns a truthy value
|
||||||
|
2) `escalade` has reached the system root directory (eg, `/`)
|
||||||
|
|
||||||
|
> **Important:**<br>Please note that `escalade` only deals with direct ancestry – it will not dive into parents' sibling directories.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Notice:** As of v3.1.0, `escalade` now includes [Deno support](http://deno.land/x/escalade)! Please see [Deno Usage](#deno) below.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```
|
||||||
|
$ npm install --save escalade
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Modes
|
||||||
|
|
||||||
|
There are two "versions" of `escalade` available:
|
||||||
|
|
||||||
|
#### "async"
|
||||||
|
> **Node.js:** >= 8.x<br>
|
||||||
|
> **Size (gzip):** 210 bytes<br>
|
||||||
|
> **Availability:** [CommonJS](https://unpkg.com/escalade/dist/index.js), [ES Module](https://unpkg.com/escalade/dist/index.mjs)
|
||||||
|
|
||||||
|
This is the primary/default mode. It makes use of `async`/`await` and [`util.promisify`](https://nodejs.org/api/util.html#util_util_promisify_original).
|
||||||
|
|
||||||
|
#### "sync"
|
||||||
|
> **Node.js:** >= 6.x<br>
|
||||||
|
> **Size (gzip):** 183 bytes<br>
|
||||||
|
> **Availability:** [CommonJS](https://unpkg.com/escalade/sync/index.js), [ES Module](https://unpkg.com/escalade/sync/index.mjs)
|
||||||
|
|
||||||
|
This is the opt-in mode, ideal for scenarios where `async` usage cannot be supported.
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
***Example Structure***
|
||||||
|
|
||||||
|
```
|
||||||
|
/Users/lukeed
|
||||||
|
└── oss
|
||||||
|
├── license
|
||||||
|
└── escalade
|
||||||
|
├── package.json
|
||||||
|
└── test
|
||||||
|
└── fixtures
|
||||||
|
├── index.js
|
||||||
|
└── foobar
|
||||||
|
└── demo.js
|
||||||
|
```
|
||||||
|
|
||||||
|
***Example Usage***
|
||||||
|
|
||||||
|
```js
|
||||||
|
//~> demo.js
|
||||||
|
import { join } from 'path';
|
||||||
|
import escalade from 'escalade';
|
||||||
|
|
||||||
|
const input = join(__dirname, 'demo.js');
|
||||||
|
// or: const input = __dirname;
|
||||||
|
|
||||||
|
const pkg = await escalade(input, (dir, names) => {
|
||||||
|
console.log('~> dir:', dir);
|
||||||
|
console.log('~> names:', names);
|
||||||
|
console.log('---');
|
||||||
|
|
||||||
|
if (names.includes('package.json')) {
|
||||||
|
// will be resolved into absolute
|
||||||
|
return 'package.json';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//~> dir: /Users/lukeed/oss/escalade/test/fixtures/foobar
|
||||||
|
//~> names: ['demo.js']
|
||||||
|
//---
|
||||||
|
//~> dir: /Users/lukeed/oss/escalade/test/fixtures
|
||||||
|
//~> names: ['index.js', 'foobar']
|
||||||
|
//---
|
||||||
|
//~> dir: /Users/lukeed/oss/escalade/test
|
||||||
|
//~> names: ['fixtures']
|
||||||
|
//---
|
||||||
|
//~> dir: /Users/lukeed/oss/escalade
|
||||||
|
//~> names: ['package.json', 'test']
|
||||||
|
//---
|
||||||
|
|
||||||
|
console.log(pkg);
|
||||||
|
//=> /Users/lukeed/oss/escalade/package.json
|
||||||
|
|
||||||
|
// Now search for "missing123.txt"
|
||||||
|
// (Assume it doesn't exist anywhere!)
|
||||||
|
const missing = await escalade(input, (dir, names) => {
|
||||||
|
console.log('~> dir:', dir);
|
||||||
|
return names.includes('missing123.txt') && 'missing123.txt';
|
||||||
|
});
|
||||||
|
|
||||||
|
//~> dir: /Users/lukeed/oss/escalade/test/fixtures/foobar
|
||||||
|
//~> dir: /Users/lukeed/oss/escalade/test/fixtures
|
||||||
|
//~> dir: /Users/lukeed/oss/escalade/test
|
||||||
|
//~> dir: /Users/lukeed/oss/escalade
|
||||||
|
//~> dir: /Users/lukeed/oss
|
||||||
|
//~> dir: /Users/lukeed
|
||||||
|
//~> dir: /Users
|
||||||
|
//~> dir: /
|
||||||
|
|
||||||
|
console.log(missing);
|
||||||
|
//=> undefined
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Note:** To run the above example with "sync" mode, import from `escalade/sync` and remove the `await` keyword.
|
||||||
|
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
### escalade(input, callback)
|
||||||
|
Returns: `string|void` or `Promise<string|void>`
|
||||||
|
|
||||||
|
When your `callback` locates a file, `escalade` will resolve/return with an absolute path.<br>
|
||||||
|
If your `callback` was never satisfied, then `escalade` will resolve/return with nothing (undefined).
|
||||||
|
|
||||||
|
> **Important:**<br>The `sync` and `async` versions share the same API.<br>The **only** difference is that `sync` is not Promise-based.
|
||||||
|
|
||||||
|
#### input
|
||||||
|
Type: `string`
|
||||||
|
|
||||||
|
The path from which to start ascending.
|
||||||
|
|
||||||
|
This may be a file or a directory path.<br>However, when `input` is a file, `escalade` will begin with its parent directory.
|
||||||
|
|
||||||
|
> **Important:** Unless given an absolute path, `input` will be resolved from `process.cwd()` location.
|
||||||
|
|
||||||
|
#### callback
|
||||||
|
Type: `Function`
|
||||||
|
|
||||||
|
The callback to execute for each ancestry level. It always is given two arguments:
|
||||||
|
|
||||||
|
1) `dir` - an absolute path of the current parent directory
|
||||||
|
2) `names` - a list (`string[]`) of contents _relative to_ the `dir` parent
|
||||||
|
|
||||||
|
> **Note:** The `names` list can contain names of files _and_ directories.
|
||||||
|
|
||||||
|
When your callback returns a _falsey_ value, then `escalade` will continue with `dir`'s parent directory, re-invoking your callback with new argument values.
|
||||||
|
|
||||||
|
When your callback returns a string, then `escalade` stops iteration immediately.<br>
|
||||||
|
If the string is an absolute path, then it's left as is. Otherwise, the string is resolved into an absolute path _from_ the `dir` that housed the satisfying condition.
|
||||||
|
|
||||||
|
> **Important:** Your `callback` can be a `Promise/AsyncFunction` when using the "async" version of `escalade`.
|
||||||
|
|
||||||
|
## Benchmarks
|
||||||
|
|
||||||
|
> Running on Node.js v10.13.0
|
||||||
|
|
||||||
|
```
|
||||||
|
# Load Time
|
||||||
|
find-up 3.891ms
|
||||||
|
escalade 0.485ms
|
||||||
|
escalade/sync 0.309ms
|
||||||
|
|
||||||
|
# Levels: 6 (target = "foo.txt"):
|
||||||
|
find-up x 24,856 ops/sec ±6.46% (55 runs sampled)
|
||||||
|
escalade x 73,084 ops/sec ±4.23% (73 runs sampled)
|
||||||
|
find-up.sync x 3,663 ops/sec ±1.12% (83 runs sampled)
|
||||||
|
escalade/sync x 9,360 ops/sec ±0.62% (88 runs sampled)
|
||||||
|
|
||||||
|
# Levels: 12 (target = "package.json"):
|
||||||
|
find-up x 29,300 ops/sec ±10.68% (70 runs sampled)
|
||||||
|
escalade x 73,685 ops/sec ± 5.66% (66 runs sampled)
|
||||||
|
find-up.sync x 1,707 ops/sec ± 0.58% (91 runs sampled)
|
||||||
|
escalade/sync x 4,667 ops/sec ± 0.68% (94 runs sampled)
|
||||||
|
|
||||||
|
# Levels: 18 (target = "missing123.txt"):
|
||||||
|
find-up x 21,818 ops/sec ±17.37% (14 runs sampled)
|
||||||
|
escalade x 67,101 ops/sec ±21.60% (20 runs sampled)
|
||||||
|
find-up.sync x 1,037 ops/sec ± 2.86% (88 runs sampled)
|
||||||
|
escalade/sync x 1,248 ops/sec ± 0.50% (93 runs sampled)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Deno
|
||||||
|
|
||||||
|
As of v3.1.0, `escalade` is available on the Deno registry.
|
||||||
|
|
||||||
|
Please note that the [API](#api) is identical and that there are still [two modes](#modes) from which to choose:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// Choose "async" mode
|
||||||
|
import escalade from 'https://deno.land/escalade/async.ts';
|
||||||
|
|
||||||
|
// Choose "sync" mode
|
||||||
|
import escalade from 'https://deno.land/escalade/sync.ts';
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Important:** The `allow-read` permission is required!
|
||||||
|
|
||||||
|
|
||||||
|
## Related
|
||||||
|
|
||||||
|
- [premove](https://github.com/lukeed/premove) - A tiny (247B) utility to remove items recursively
|
||||||
|
- [totalist](https://github.com/lukeed/totalist) - A tiny (195B to 224B) utility to recursively list all (total) files in a directory
|
||||||
|
- [mk-dirs](https://github.com/lukeed/mk-dirs) - A tiny (420B) utility to make a directory and its parents, recursively
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MIT © [Luke Edwards](https://lukeed.com)
|
15
mybulma/node_modules/fs-minipass/LICENSE
generated
vendored
Normal file
15
mybulma/node_modules/fs-minipass/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
The ISC License
|
||||||
|
|
||||||
|
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||||
|
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
70
mybulma/node_modules/fs-minipass/README.md
generated
vendored
Normal file
70
mybulma/node_modules/fs-minipass/README.md
generated
vendored
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
# fs-minipass
|
||||||
|
|
||||||
|
Filesystem streams based on [minipass](http://npm.im/minipass).
|
||||||
|
|
||||||
|
4 classes are exported:
|
||||||
|
|
||||||
|
- ReadStream
|
||||||
|
- ReadStreamSync
|
||||||
|
- WriteStream
|
||||||
|
- WriteStreamSync
|
||||||
|
|
||||||
|
When using `ReadStreamSync`, all of the data is made available
|
||||||
|
immediately upon consuming the stream. Nothing is buffered in memory
|
||||||
|
when the stream is constructed. If the stream is piped to a writer,
|
||||||
|
then it will synchronously `read()` and emit data into the writer as
|
||||||
|
fast as the writer can consume it. (That is, it will respect
|
||||||
|
backpressure.) If you call `stream.read()` then it will read the
|
||||||
|
entire file and return the contents.
|
||||||
|
|
||||||
|
When using `WriteStreamSync`, every write is flushed to the file
|
||||||
|
synchronously. If your writes all come in a single tick, then it'll
|
||||||
|
write it all out in a single tick. It's as synchronous as you are.
|
||||||
|
|
||||||
|
The async versions work much like their node builtin counterparts,
|
||||||
|
with the exception of introducing significantly less Stream machinery
|
||||||
|
overhead.
|
||||||
|
|
||||||
|
## USAGE
|
||||||
|
|
||||||
|
It's just streams, you pipe them or read() them or write() to them.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const fsm = require('fs-minipass')
|
||||||
|
const readStream = new fsm.ReadStream('file.txt')
|
||||||
|
const writeStream = new fsm.WriteStream('output.txt')
|
||||||
|
writeStream.write('some file header or whatever\n')
|
||||||
|
readStream.pipe(writeStream)
|
||||||
|
```
|
||||||
|
|
||||||
|
## ReadStream(path, options)
|
||||||
|
|
||||||
|
Path string is required, but somewhat irrelevant if an open file
|
||||||
|
descriptor is passed in as an option.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
|
||||||
|
- `fd` Pass in a numeric file descriptor, if the file is already open.
|
||||||
|
- `readSize` The size of reads to do, defaults to 16MB
|
||||||
|
- `size` The size of the file, if known. Prevents zero-byte read()
|
||||||
|
call at the end.
|
||||||
|
- `autoClose` Set to `false` to prevent the file descriptor from being
|
||||||
|
closed when the file is done being read.
|
||||||
|
|
||||||
|
## WriteStream(path, options)
|
||||||
|
|
||||||
|
Path string is required, but somewhat irrelevant if an open file
|
||||||
|
descriptor is passed in as an option.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
|
||||||
|
- `fd` Pass in a numeric file descriptor, if the file is already open.
|
||||||
|
- `mode` The mode to create the file with. Defaults to `0o666`.
|
||||||
|
- `start` The position in the file to start reading. If not
|
||||||
|
specified, then the file will start writing at position zero, and be
|
||||||
|
truncated by default.
|
||||||
|
- `autoClose` Set to `false` to prevent the file descriptor from being
|
||||||
|
closed when the stream is ended.
|
||||||
|
- `flags` Flags to use when opening the file. Irrelevant if `fd` is
|
||||||
|
passed in, since file won't be opened in that case. Defaults to
|
||||||
|
`'a'` if a `pos` is specified, or `'w'` otherwise.
|
422
mybulma/node_modules/fs-minipass/index.js
generated
vendored
Normal file
422
mybulma/node_modules/fs-minipass/index.js
generated
vendored
Normal file
|
@ -0,0 +1,422 @@
|
||||||
|
'use strict'
|
||||||
|
const MiniPass = require('minipass')
|
||||||
|
const EE = require('events').EventEmitter
|
||||||
|
const fs = require('fs')
|
||||||
|
|
||||||
|
let writev = fs.writev
|
||||||
|
/* istanbul ignore next */
|
||||||
|
if (!writev) {
|
||||||
|
// This entire block can be removed if support for earlier than Node.js
|
||||||
|
// 12.9.0 is not needed.
|
||||||
|
const binding = process.binding('fs')
|
||||||
|
const FSReqWrap = binding.FSReqWrap || binding.FSReqCallback
|
||||||
|
|
||||||
|
writev = (fd, iovec, pos, cb) => {
|
||||||
|
const done = (er, bw) => cb(er, bw, iovec)
|
||||||
|
const req = new FSReqWrap()
|
||||||
|
req.oncomplete = done
|
||||||
|
binding.writeBuffers(fd, iovec, pos, req)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const _autoClose = Symbol('_autoClose')
|
||||||
|
const _close = Symbol('_close')
|
||||||
|
const _ended = Symbol('_ended')
|
||||||
|
const _fd = Symbol('_fd')
|
||||||
|
const _finished = Symbol('_finished')
|
||||||
|
const _flags = Symbol('_flags')
|
||||||
|
const _flush = Symbol('_flush')
|
||||||
|
const _handleChunk = Symbol('_handleChunk')
|
||||||
|
const _makeBuf = Symbol('_makeBuf')
|
||||||
|
const _mode = Symbol('_mode')
|
||||||
|
const _needDrain = Symbol('_needDrain')
|
||||||
|
const _onerror = Symbol('_onerror')
|
||||||
|
const _onopen = Symbol('_onopen')
|
||||||
|
const _onread = Symbol('_onread')
|
||||||
|
const _onwrite = Symbol('_onwrite')
|
||||||
|
const _open = Symbol('_open')
|
||||||
|
const _path = Symbol('_path')
|
||||||
|
const _pos = Symbol('_pos')
|
||||||
|
const _queue = Symbol('_queue')
|
||||||
|
const _read = Symbol('_read')
|
||||||
|
const _readSize = Symbol('_readSize')
|
||||||
|
const _reading = Symbol('_reading')
|
||||||
|
const _remain = Symbol('_remain')
|
||||||
|
const _size = Symbol('_size')
|
||||||
|
const _write = Symbol('_write')
|
||||||
|
const _writing = Symbol('_writing')
|
||||||
|
const _defaultFlag = Symbol('_defaultFlag')
|
||||||
|
const _errored = Symbol('_errored')
|
||||||
|
|
||||||
|
class ReadStream extends MiniPass {
|
||||||
|
constructor (path, opt) {
|
||||||
|
opt = opt || {}
|
||||||
|
super(opt)
|
||||||
|
|
||||||
|
this.readable = true
|
||||||
|
this.writable = false
|
||||||
|
|
||||||
|
if (typeof path !== 'string')
|
||||||
|
throw new TypeError('path must be a string')
|
||||||
|
|
||||||
|
this[_errored] = false
|
||||||
|
this[_fd] = typeof opt.fd === 'number' ? opt.fd : null
|
||||||
|
this[_path] = path
|
||||||
|
this[_readSize] = opt.readSize || 16*1024*1024
|
||||||
|
this[_reading] = false
|
||||||
|
this[_size] = typeof opt.size === 'number' ? opt.size : Infinity
|
||||||
|
this[_remain] = this[_size]
|
||||||
|
this[_autoClose] = typeof opt.autoClose === 'boolean' ?
|
||||||
|
opt.autoClose : true
|
||||||
|
|
||||||
|
if (typeof this[_fd] === 'number')
|
||||||
|
this[_read]()
|
||||||
|
else
|
||||||
|
this[_open]()
|
||||||
|
}
|
||||||
|
|
||||||
|
get fd () { return this[_fd] }
|
||||||
|
get path () { return this[_path] }
|
||||||
|
|
||||||
|
write () {
|
||||||
|
throw new TypeError('this is a readable stream')
|
||||||
|
}
|
||||||
|
|
||||||
|
end () {
|
||||||
|
throw new TypeError('this is a readable stream')
|
||||||
|
}
|
||||||
|
|
||||||
|
[_open] () {
|
||||||
|
fs.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd))
|
||||||
|
}
|
||||||
|
|
||||||
|
[_onopen] (er, fd) {
|
||||||
|
if (er)
|
||||||
|
this[_onerror](er)
|
||||||
|
else {
|
||||||
|
this[_fd] = fd
|
||||||
|
this.emit('open', fd)
|
||||||
|
this[_read]()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[_makeBuf] () {
|
||||||
|
return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain]))
|
||||||
|
}
|
||||||
|
|
||||||
|
[_read] () {
|
||||||
|
if (!this[_reading]) {
|
||||||
|
this[_reading] = true
|
||||||
|
const buf = this[_makeBuf]()
|
||||||
|
/* istanbul ignore if */
|
||||||
|
if (buf.length === 0)
|
||||||
|
return process.nextTick(() => this[_onread](null, 0, buf))
|
||||||
|
fs.read(this[_fd], buf, 0, buf.length, null, (er, br, buf) =>
|
||||||
|
this[_onread](er, br, buf))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[_onread] (er, br, buf) {
|
||||||
|
this[_reading] = false
|
||||||
|
if (er)
|
||||||
|
this[_onerror](er)
|
||||||
|
else if (this[_handleChunk](br, buf))
|
||||||
|
this[_read]()
|
||||||
|
}
|
||||||
|
|
||||||
|
[_close] () {
|
||||||
|
if (this[_autoClose] && typeof this[_fd] === 'number') {
|
||||||
|
const fd = this[_fd]
|
||||||
|
this[_fd] = null
|
||||||
|
fs.close(fd, er => er ? this.emit('error', er) : this.emit('close'))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[_onerror] (er) {
|
||||||
|
this[_reading] = true
|
||||||
|
this[_close]()
|
||||||
|
this.emit('error', er)
|
||||||
|
}
|
||||||
|
|
||||||
|
[_handleChunk] (br, buf) {
|
||||||
|
let ret = false
|
||||||
|
// no effect if infinite
|
||||||
|
this[_remain] -= br
|
||||||
|
if (br > 0)
|
||||||
|
ret = super.write(br < buf.length ? buf.slice(0, br) : buf)
|
||||||
|
|
||||||
|
if (br === 0 || this[_remain] <= 0) {
|
||||||
|
ret = false
|
||||||
|
this[_close]()
|
||||||
|
super.end()
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
emit (ev, data) {
|
||||||
|
switch (ev) {
|
||||||
|
case 'prefinish':
|
||||||
|
case 'finish':
|
||||||
|
break
|
||||||
|
|
||||||
|
case 'drain':
|
||||||
|
if (typeof this[_fd] === 'number')
|
||||||
|
this[_read]()
|
||||||
|
break
|
||||||
|
|
||||||
|
case 'error':
|
||||||
|
if (this[_errored])
|
||||||
|
return
|
||||||
|
this[_errored] = true
|
||||||
|
return super.emit(ev, data)
|
||||||
|
|
||||||
|
default:
|
||||||
|
return super.emit(ev, data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ReadStreamSync extends ReadStream {
|
||||||
|
[_open] () {
|
||||||
|
let threw = true
|
||||||
|
try {
|
||||||
|
this[_onopen](null, fs.openSync(this[_path], 'r'))
|
||||||
|
threw = false
|
||||||
|
} finally {
|
||||||
|
if (threw)
|
||||||
|
this[_close]()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[_read] () {
|
||||||
|
let threw = true
|
||||||
|
try {
|
||||||
|
if (!this[_reading]) {
|
||||||
|
this[_reading] = true
|
||||||
|
do {
|
||||||
|
const buf = this[_makeBuf]()
|
||||||
|
/* istanbul ignore next */
|
||||||
|
const br = buf.length === 0 ? 0
|
||||||
|
: fs.readSync(this[_fd], buf, 0, buf.length, null)
|
||||||
|
if (!this[_handleChunk](br, buf))
|
||||||
|
break
|
||||||
|
} while (true)
|
||||||
|
this[_reading] = false
|
||||||
|
}
|
||||||
|
threw = false
|
||||||
|
} finally {
|
||||||
|
if (threw)
|
||||||
|
this[_close]()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[_close] () {
|
||||||
|
if (this[_autoClose] && typeof this[_fd] === 'number') {
|
||||||
|
const fd = this[_fd]
|
||||||
|
this[_fd] = null
|
||||||
|
fs.closeSync(fd)
|
||||||
|
this.emit('close')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class WriteStream extends EE {
|
||||||
|
constructor (path, opt) {
|
||||||
|
opt = opt || {}
|
||||||
|
super(opt)
|
||||||
|
this.readable = false
|
||||||
|
this.writable = true
|
||||||
|
this[_errored] = false
|
||||||
|
this[_writing] = false
|
||||||
|
this[_ended] = false
|
||||||
|
this[_needDrain] = false
|
||||||
|
this[_queue] = []
|
||||||
|
this[_path] = path
|
||||||
|
this[_fd] = typeof opt.fd === 'number' ? opt.fd : null
|
||||||
|
this[_mode] = opt.mode === undefined ? 0o666 : opt.mode
|
||||||
|
this[_pos] = typeof opt.start === 'number' ? opt.start : null
|
||||||
|
this[_autoClose] = typeof opt.autoClose === 'boolean' ?
|
||||||
|
opt.autoClose : true
|
||||||
|
|
||||||
|
// truncating makes no sense when writing into the middle
|
||||||
|
const defaultFlag = this[_pos] !== null ? 'r+' : 'w'
|
||||||
|
this[_defaultFlag] = opt.flags === undefined
|
||||||
|
this[_flags] = this[_defaultFlag] ? defaultFlag : opt.flags
|
||||||
|
|
||||||
|
if (this[_fd] === null)
|
||||||
|
this[_open]()
|
||||||
|
}
|
||||||
|
|
||||||
|
emit (ev, data) {
|
||||||
|
if (ev === 'error') {
|
||||||
|
if (this[_errored])
|
||||||
|
return
|
||||||
|
this[_errored] = true
|
||||||
|
}
|
||||||
|
return super.emit(ev, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
get fd () { return this[_fd] }
|
||||||
|
get path () { return this[_path] }
|
||||||
|
|
||||||
|
[_onerror] (er) {
|
||||||
|
this[_close]()
|
||||||
|
this[_writing] = true
|
||||||
|
this.emit('error', er)
|
||||||
|
}
|
||||||
|
|
||||||
|
[_open] () {
|
||||||
|
fs.open(this[_path], this[_flags], this[_mode],
|
||||||
|
(er, fd) => this[_onopen](er, fd))
|
||||||
|
}
|
||||||
|
|
||||||
|
[_onopen] (er, fd) {
|
||||||
|
if (this[_defaultFlag] &&
|
||||||
|
this[_flags] === 'r+' &&
|
||||||
|
er && er.code === 'ENOENT') {
|
||||||
|
this[_flags] = 'w'
|
||||||
|
this[_open]()
|
||||||
|
} else if (er)
|
||||||
|
this[_onerror](er)
|
||||||
|
else {
|
||||||
|
this[_fd] = fd
|
||||||
|
this.emit('open', fd)
|
||||||
|
this[_flush]()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
end (buf, enc) {
|
||||||
|
if (buf)
|
||||||
|
this.write(buf, enc)
|
||||||
|
|
||||||
|
this[_ended] = true
|
||||||
|
|
||||||
|
// synthetic after-write logic, where drain/finish live
|
||||||
|
if (!this[_writing] && !this[_queue].length &&
|
||||||
|
typeof this[_fd] === 'number')
|
||||||
|
this[_onwrite](null, 0)
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
write (buf, enc) {
|
||||||
|
if (typeof buf === 'string')
|
||||||
|
buf = Buffer.from(buf, enc)
|
||||||
|
|
||||||
|
if (this[_ended]) {
|
||||||
|
this.emit('error', new Error('write() after end()'))
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this[_fd] === null || this[_writing] || this[_queue].length) {
|
||||||
|
this[_queue].push(buf)
|
||||||
|
this[_needDrain] = true
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
this[_writing] = true
|
||||||
|
this[_write](buf)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
[_write] (buf) {
|
||||||
|
fs.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) =>
|
||||||
|
this[_onwrite](er, bw))
|
||||||
|
}
|
||||||
|
|
||||||
|
[_onwrite] (er, bw) {
|
||||||
|
if (er)
|
||||||
|
this[_onerror](er)
|
||||||
|
else {
|
||||||
|
if (this[_pos] !== null)
|
||||||
|
this[_pos] += bw
|
||||||
|
if (this[_queue].length)
|
||||||
|
this[_flush]()
|
||||||
|
else {
|
||||||
|
this[_writing] = false
|
||||||
|
|
||||||
|
if (this[_ended] && !this[_finished]) {
|
||||||
|
this[_finished] = true
|
||||||
|
this[_close]()
|
||||||
|
this.emit('finish')
|
||||||
|
} else if (this[_needDrain]) {
|
||||||
|
this[_needDrain] = false
|
||||||
|
this.emit('drain')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[_flush] () {
|
||||||
|
if (this[_queue].length === 0) {
|
||||||
|
if (this[_ended])
|
||||||
|
this[_onwrite](null, 0)
|
||||||
|
} else if (this[_queue].length === 1)
|
||||||
|
this[_write](this[_queue].pop())
|
||||||
|
else {
|
||||||
|
const iovec = this[_queue]
|
||||||
|
this[_queue] = []
|
||||||
|
writev(this[_fd], iovec, this[_pos],
|
||||||
|
(er, bw) => this[_onwrite](er, bw))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[_close] () {
|
||||||
|
if (this[_autoClose] && typeof this[_fd] === 'number') {
|
||||||
|
const fd = this[_fd]
|
||||||
|
this[_fd] = null
|
||||||
|
fs.close(fd, er => er ? this.emit('error', er) : this.emit('close'))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class WriteStreamSync extends WriteStream {
|
||||||
|
[_open] () {
|
||||||
|
let fd
|
||||||
|
// only wrap in a try{} block if we know we'll retry, to avoid
|
||||||
|
// the rethrow obscuring the error's source frame in most cases.
|
||||||
|
if (this[_defaultFlag] && this[_flags] === 'r+') {
|
||||||
|
try {
|
||||||
|
fd = fs.openSync(this[_path], this[_flags], this[_mode])
|
||||||
|
} catch (er) {
|
||||||
|
if (er.code === 'ENOENT') {
|
||||||
|
this[_flags] = 'w'
|
||||||
|
return this[_open]()
|
||||||
|
} else
|
||||||
|
throw er
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
fd = fs.openSync(this[_path], this[_flags], this[_mode])
|
||||||
|
|
||||||
|
this[_onopen](null, fd)
|
||||||
|
}
|
||||||
|
|
||||||
|
[_close] () {
|
||||||
|
if (this[_autoClose] && typeof this[_fd] === 'number') {
|
||||||
|
const fd = this[_fd]
|
||||||
|
this[_fd] = null
|
||||||
|
fs.closeSync(fd)
|
||||||
|
this.emit('close')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[_write] (buf) {
|
||||||
|
// throw the original, but try to close if it fails
|
||||||
|
let threw = true
|
||||||
|
try {
|
||||||
|
this[_onwrite](null,
|
||||||
|
fs.writeSync(this[_fd], buf, 0, buf.length, this[_pos]))
|
||||||
|
threw = false
|
||||||
|
} finally {
|
||||||
|
if (threw)
|
||||||
|
try { this[_close]() } catch (_) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.ReadStream = ReadStream
|
||||||
|
exports.ReadStreamSync = ReadStreamSync
|
||||||
|
|
||||||
|
exports.WriteStream = WriteStream
|
||||||
|
exports.WriteStreamSync = WriteStreamSync
|
39
mybulma/node_modules/fs-minipass/package.json
generated
vendored
Normal file
39
mybulma/node_modules/fs-minipass/package.json
generated
vendored
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
"name": "fs-minipass",
|
||||||
|
"version": "2.1.0",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "tap",
|
||||||
|
"preversion": "npm test",
|
||||||
|
"postversion": "npm publish",
|
||||||
|
"postpublish": "git push origin --follow-tags"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
||||||
|
"license": "ISC",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/npm/fs-minipass.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/npm/fs-minipass/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/npm/fs-minipass#readme",
|
||||||
|
"description": "fs read and write streams based on minipass",
|
||||||
|
"dependencies": {
|
||||||
|
"minipass": "^3.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"mutate-fs": "^2.0.1",
|
||||||
|
"tap": "^14.6.4"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"index.js"
|
||||||
|
],
|
||||||
|
"tap": {
|
||||||
|
"check-coverage": true
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 8"
|
||||||
|
}
|
||||||
|
}
|
402
mybulma/node_modules/gauge/README.md
generated
vendored
Normal file
402
mybulma/node_modules/gauge/README.md
generated
vendored
Normal file
|
@ -0,0 +1,402 @@
|
||||||
|
gauge
|
||||||
|
=====
|
||||||
|
|
||||||
|
A nearly stateless terminal based horizontal gauge / progress bar.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var Gauge = require("gauge")
|
||||||
|
|
||||||
|
var gauge = new Gauge()
|
||||||
|
|
||||||
|
gauge.show("working…", 0)
|
||||||
|
setTimeout(() => { gauge.pulse(); gauge.show("working…", 0.25) }, 500)
|
||||||
|
setTimeout(() => { gauge.pulse(); gauge.show("working…", 0.50) }, 1000)
|
||||||
|
setTimeout(() => { gauge.pulse(); gauge.show("working…", 0.75) }, 1500)
|
||||||
|
setTimeout(() => { gauge.pulse(); gauge.show("working…", 0.99) }, 2000)
|
||||||
|
setTimeout(() => gauge.hide(), 2300)
|
||||||
|
```
|
||||||
|
|
||||||
|
See also the [demos](docs/demo.js):
|
||||||
|
|
||||||
|
![](./docs/gauge-demo.gif)
|
||||||
|
|
||||||
|
|
||||||
|
### CHANGES FROM 1.x
|
||||||
|
|
||||||
|
Gauge 2.x is breaking release, please see the [changelog] for details on
|
||||||
|
what's changed if you were previously a user of this module.
|
||||||
|
|
||||||
|
[changelog]: CHANGELOG.md
|
||||||
|
|
||||||
|
### THE GAUGE CLASS
|
||||||
|
|
||||||
|
This is the typical interface to the module– it provides a pretty
|
||||||
|
fire-and-forget interface to displaying your status information.
|
||||||
|
|
||||||
|
```
|
||||||
|
var Gauge = require("gauge")
|
||||||
|
|
||||||
|
var gauge = new Gauge([stream], [options])
|
||||||
|
```
|
||||||
|
|
||||||
|
* **stream** – *(optional, default STDERR)* A stream that progress bar
|
||||||
|
updates are to be written to. Gauge honors backpressure and will pause
|
||||||
|
most writing if it is indicated.
|
||||||
|
* **options** – *(optional)* An option object.
|
||||||
|
|
||||||
|
Constructs a new gauge. Gauges are drawn on a single line, and are not drawn
|
||||||
|
if **stream** isn't a tty and a tty isn't explicitly provided.
|
||||||
|
|
||||||
|
If **stream** is a terminal or if you pass in **tty** to **options** then we
|
||||||
|
will detect terminal resizes and redraw to fit. We do this by watching for
|
||||||
|
`resize` events on the tty. (To work around a bug in versions of Node prior
|
||||||
|
to 2.5.0, we watch for them on stdout if the tty is stderr.) Resizes to
|
||||||
|
larger window sizes will be clean, but shrinking the window will always
|
||||||
|
result in some cruft.
|
||||||
|
|
||||||
|
**IMPORTANT:** If you previously were passing in a non-tty stream but you still
|
||||||
|
want output (for example, a stream wrapped by the `ansi` module) then you
|
||||||
|
need to pass in the **tty** option below, as `gauge` needs access to
|
||||||
|
the underlying tty in order to do things like terminal resizes and terminal
|
||||||
|
width detection.
|
||||||
|
|
||||||
|
The **options** object can have the following properties, all of which are
|
||||||
|
optional:
|
||||||
|
|
||||||
|
* **updateInterval**: How often gauge updates should be drawn, in milliseconds.
|
||||||
|
* **fixedFramerate**: Defaults to false on node 0.8, true on everything
|
||||||
|
else. When this is true a timer is created to trigger once every
|
||||||
|
`updateInterval` ms, when false, updates are printed as soon as they come
|
||||||
|
in but updates more often than `updateInterval` are ignored. The reason
|
||||||
|
0.8 doesn't have this set to true is that it can't `unref` its timer and
|
||||||
|
so it would stop your program from exiting– if you want to use this
|
||||||
|
feature with 0.8 just make sure you call `gauge.disable()` before you
|
||||||
|
expect your program to exit.
|
||||||
|
* **themes**: A themeset to use when selecting the theme to use. Defaults
|
||||||
|
to `gauge/themes`, see the [themes] documentation for details.
|
||||||
|
* **theme**: Select a theme for use, it can be a:
|
||||||
|
* Theme object, in which case the **themes** is not used.
|
||||||
|
* The name of a theme, which will be looked up in the current *themes*
|
||||||
|
object.
|
||||||
|
* A configuration object with any of `hasUnicode`, `hasColor` or
|
||||||
|
`platform` keys, which if will be used to override our guesses when making
|
||||||
|
a default theme selection.
|
||||||
|
|
||||||
|
If no theme is selected then a default is picked using a combination of our
|
||||||
|
best guesses at your OS, color support and unicode support.
|
||||||
|
* **template**: Describes what you want your gauge to look like. The
|
||||||
|
default is what npm uses. Detailed [documentation] is later in this
|
||||||
|
document.
|
||||||
|
* **hideCursor**: Defaults to true. If true, then the cursor will be hidden
|
||||||
|
while the gauge is displayed.
|
||||||
|
* **tty**: The tty that you're ultimately writing to. Defaults to the same
|
||||||
|
as **stream**. This is used for detecting the width of the terminal and
|
||||||
|
resizes. The width used is `tty.columns - 1`. If no tty is available then
|
||||||
|
a width of `79` is assumed.
|
||||||
|
* **enabled**: Defaults to true if `tty` is a TTY, false otherwise. If true
|
||||||
|
the gauge starts enabled. If disabled then all update commands are
|
||||||
|
ignored and no gauge will be printed until you call `.enable()`.
|
||||||
|
* **Plumbing**: The class to use to actually generate the gauge for
|
||||||
|
printing. This defaults to `require('gauge/plumbing')` and ordinarily you
|
||||||
|
shouldn't need to override this.
|
||||||
|
* **cleanupOnExit**: Defaults to true. Ordinarily we register an exit
|
||||||
|
handler to make sure your cursor is turned back on and the progress bar
|
||||||
|
erased when your process exits, even if you Ctrl-C out or otherwise exit
|
||||||
|
unexpectedly. You can disable this and it won't register the exit handler.
|
||||||
|
|
||||||
|
[has-unicode]: https://www.npmjs.com/package/has-unicode
|
||||||
|
[themes]: #themes
|
||||||
|
[documentation]: #templates
|
||||||
|
|
||||||
|
#### `gauge.show(section | status, [completed])`
|
||||||
|
|
||||||
|
The first argument is either the section, the name of the current thing
|
||||||
|
contributing to progress, or an object with keys like **section**,
|
||||||
|
**subsection** & **completed** (or any others you have types for in a custom
|
||||||
|
template). If you don't want to update or set any of these you can pass
|
||||||
|
`null` and it will be ignored.
|
||||||
|
|
||||||
|
The second argument is the percent completed as a value between 0 and 1.
|
||||||
|
Without it, completion is just not updated. You'll also note that completion
|
||||||
|
can be passed in as part of a status object as the first argument. If both
|
||||||
|
it and the completed argument are passed in, the completed argument wins.
|
||||||
|
|
||||||
|
#### `gauge.hide([cb])`
|
||||||
|
|
||||||
|
Removes the gauge from the terminal. Optionally, callback `cb` after IO has
|
||||||
|
had an opportunity to happen (currently this just means after `setImmediate`
|
||||||
|
has called back.)
|
||||||
|
|
||||||
|
It turns out this is important when you're pausing the progress bar on one
|
||||||
|
filehandle and printing to another– otherwise (with a big enough print) node
|
||||||
|
can end up printing the "end progress bar" bits to the progress bar filehandle
|
||||||
|
while other stuff is printing to another filehandle. These getting interleaved
|
||||||
|
can cause corruption in some terminals.
|
||||||
|
|
||||||
|
#### `gauge.pulse([subsection])`
|
||||||
|
|
||||||
|
* **subsection** – *(optional)* The specific thing that triggered this pulse
|
||||||
|
|
||||||
|
Spins the spinner in the gauge to show output. If **subsection** is
|
||||||
|
included then it will be combined with the last name passed to `gauge.show`.
|
||||||
|
|
||||||
|
#### `gauge.disable()`
|
||||||
|
|
||||||
|
Hides the gauge and ignores further calls to `show` or `pulse`.
|
||||||
|
|
||||||
|
#### `gauge.enable()`
|
||||||
|
|
||||||
|
Shows the gauge and resumes updating when `show` or `pulse` is called.
|
||||||
|
|
||||||
|
#### `gauge.isEnabled()`
|
||||||
|
|
||||||
|
Returns true if the gauge is enabled.
|
||||||
|
|
||||||
|
#### `gauge.setThemeset(themes)`
|
||||||
|
|
||||||
|
Change the themeset to select a theme from. The same as the `themes` option
|
||||||
|
used in the constructor. The theme will be reselected from this themeset.
|
||||||
|
|
||||||
|
#### `gauge.setTheme(theme)`
|
||||||
|
|
||||||
|
Change the active theme, will be displayed with the next show or pulse. This can be:
|
||||||
|
|
||||||
|
* Theme object, in which case the **themes** is not used.
|
||||||
|
* The name of a theme, which will be looked up in the current *themes*
|
||||||
|
object.
|
||||||
|
* A configuration object with any of `hasUnicode`, `hasColor` or
|
||||||
|
`platform` keys, which if will be used to override our guesses when making
|
||||||
|
a default theme selection.
|
||||||
|
|
||||||
|
If no theme is selected then a default is picked using a combination of our
|
||||||
|
best guesses at your OS, color support and unicode support.
|
||||||
|
|
||||||
|
#### `gauge.setTemplate(template)`
|
||||||
|
|
||||||
|
Change the active template, will be displayed with the next show or pulse
|
||||||
|
|
||||||
|
### Tracking Completion
|
||||||
|
|
||||||
|
If you have more than one thing going on that you want to track completion
|
||||||
|
of, you may find the related [are-we-there-yet] helpful. It's `change`
|
||||||
|
event can be wired up to the `show` method to get a more traditional
|
||||||
|
progress bar interface.
|
||||||
|
|
||||||
|
[are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet
|
||||||
|
|
||||||
|
### THEMES
|
||||||
|
|
||||||
|
```
|
||||||
|
var themes = require('gauge/themes')
|
||||||
|
|
||||||
|
// fetch the default color unicode theme for this platform
|
||||||
|
var ourTheme = themes({hasUnicode: true, hasColor: true})
|
||||||
|
|
||||||
|
// fetch the default non-color unicode theme for osx
|
||||||
|
var ourTheme = themes({hasUnicode: true, hasColor: false, platform: 'darwin'})
|
||||||
|
|
||||||
|
// create a new theme based on the color ascii theme for this platform
|
||||||
|
// that brackets the progress bar with arrows
|
||||||
|
var ourTheme = themes.newTheme(themes({hasUnicode: false, hasColor: true}), {
|
||||||
|
preProgressbar: '→',
|
||||||
|
postProgressbar: '←'
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
The object returned by `gauge/themes` is an instance of the `ThemeSet` class.
|
||||||
|
|
||||||
|
```
|
||||||
|
var ThemeSet = require('gauge/theme-set')
|
||||||
|
var themes = new ThemeSet()
|
||||||
|
// or
|
||||||
|
var themes = require('gauge/themes')
|
||||||
|
var mythemes = themes.newThemeSet() // creates a new themeset based on the default themes
|
||||||
|
```
|
||||||
|
|
||||||
|
#### themes(opts)
|
||||||
|
#### themes.getDefault(opts)
|
||||||
|
|
||||||
|
Theme objects are a function that fetches the default theme based on
|
||||||
|
platform, unicode and color support.
|
||||||
|
|
||||||
|
Options is an object with the following properties:
|
||||||
|
|
||||||
|
* **hasUnicode** - If true, fetch a unicode theme, if no unicode theme is
|
||||||
|
available then a non-unicode theme will be used.
|
||||||
|
* **hasColor** - If true, fetch a color theme, if no color theme is
|
||||||
|
available a non-color theme will be used.
|
||||||
|
* **platform** (optional) - Defaults to `process.platform`. If no
|
||||||
|
platform match is available then `fallback` is used instead.
|
||||||
|
|
||||||
|
If no compatible theme can be found then an error will be thrown with a
|
||||||
|
`code` of `EMISSINGTHEME`.
|
||||||
|
|
||||||
|
#### themes.addTheme(themeName, themeObj)
|
||||||
|
#### themes.addTheme(themeName, [parentTheme], newTheme)
|
||||||
|
|
||||||
|
Adds a named theme to the themeset. You can pass in either a theme object,
|
||||||
|
as returned by `themes.newTheme` or the arguments you'd pass to
|
||||||
|
`themes.newTheme`.
|
||||||
|
|
||||||
|
#### themes.getThemeNames()
|
||||||
|
|
||||||
|
Return a list of all of the names of the themes in this themeset. Suitable
|
||||||
|
for use in `themes.getTheme(…)`.
|
||||||
|
|
||||||
|
#### themes.getTheme(name)
|
||||||
|
|
||||||
|
Returns the theme object from this theme set named `name`.
|
||||||
|
|
||||||
|
If `name` does not exist in this themeset an error will be thrown with
|
||||||
|
a `code` of `EMISSINGTHEME`.
|
||||||
|
|
||||||
|
#### themes.setDefault([opts], themeName)
|
||||||
|
|
||||||
|
`opts` is an object with the following properties.
|
||||||
|
|
||||||
|
* **platform** - Defaults to `'fallback'`. If your theme is platform
|
||||||
|
specific, specify that here with the platform from `process.platform`, eg,
|
||||||
|
`win32`, `darwin`, etc.
|
||||||
|
* **hasUnicode** - Defaults to `false`. If your theme uses unicode you
|
||||||
|
should set this to true.
|
||||||
|
* **hasColor** - Defaults to `false`. If your theme uses color you should
|
||||||
|
set this to true.
|
||||||
|
|
||||||
|
`themeName` is the name of the theme (as given to `addTheme`) to use for
|
||||||
|
this set of `opts`.
|
||||||
|
|
||||||
|
#### themes.newTheme([parentTheme,] newTheme)
|
||||||
|
|
||||||
|
Create a new theme object based on `parentTheme`. If no `parentTheme` is
|
||||||
|
provided then a minimal parentTheme that defines functions for rendering the
|
||||||
|
activity indicator (spinner) and progress bar will be defined. (This
|
||||||
|
fallback parent is defined in `gauge/base-theme`.)
|
||||||
|
|
||||||
|
newTheme should be a bare object– we'll start by discussing the properties
|
||||||
|
defined by the default themes:
|
||||||
|
|
||||||
|
* **preProgressbar** - displayed prior to the progress bar, if the progress
|
||||||
|
bar is displayed.
|
||||||
|
* **postProgressbar** - displayed after the progress bar, if the progress bar
|
||||||
|
is displayed.
|
||||||
|
* **progressBarTheme** - The subtheme passed through to the progress bar
|
||||||
|
renderer, it's an object with `complete` and `remaining` properties
|
||||||
|
that are the strings you want repeated for those sections of the progress
|
||||||
|
bar.
|
||||||
|
* **activityIndicatorTheme** - The theme for the activity indicator (spinner),
|
||||||
|
this can either be a string, in which each character is a different step, or
|
||||||
|
an array of strings.
|
||||||
|
* **preSubsection** - Displayed as a separator between the `section` and
|
||||||
|
`subsection` when the latter is printed.
|
||||||
|
|
||||||
|
More generally, themes can have any value that would be a valid value when rendering
|
||||||
|
templates. The properties in the theme are used when their name matches a type in
|
||||||
|
the template. Their values can be:
|
||||||
|
|
||||||
|
* **strings & numbers** - They'll be included as is
|
||||||
|
* **function (values, theme, width)** - Should return what you want in your output.
|
||||||
|
*values* is an object with values provided via `gauge.show`,
|
||||||
|
*theme* is the theme specific to this item (see below) or this theme object,
|
||||||
|
and *width* is the number of characters wide your result should be.
|
||||||
|
|
||||||
|
There are a couple of special prefixes:
|
||||||
|
|
||||||
|
* **pre** - Is shown prior to the property, if its displayed.
|
||||||
|
* **post** - Is shown after the property, if its displayed.
|
||||||
|
|
||||||
|
And one special suffix:
|
||||||
|
|
||||||
|
* **Theme** - Its value is passed to a function-type item as the theme.
|
||||||
|
|
||||||
|
#### themes.addToAllThemes(theme)
|
||||||
|
|
||||||
|
This *mixes-in* `theme` into all themes currently defined. It also adds it
|
||||||
|
to the default parent theme for this themeset, so future themes added to
|
||||||
|
this themeset will get the values from `theme` by default.
|
||||||
|
|
||||||
|
#### themes.newThemeSet()
|
||||||
|
|
||||||
|
Copy the current themeset into a new one. This allows you to easily inherit
|
||||||
|
one themeset from another.
|
||||||
|
|
||||||
|
### TEMPLATES
|
||||||
|
|
||||||
|
A template is an array of objects and strings that, after being evaluated,
|
||||||
|
will be turned into the gauge line. The default template is:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
[
|
||||||
|
{type: 'progressbar', length: 20},
|
||||||
|
{type: 'activityIndicator', kerning: 1, length: 1},
|
||||||
|
{type: 'section', kerning: 1, default: ''},
|
||||||
|
{type: 'subsection', kerning: 1, default: ''}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
The various template elements can either be **plain strings**, in which case they will
|
||||||
|
be be included verbatum in the output, or objects with the following properties:
|
||||||
|
|
||||||
|
* *type* can be any of the following plus any keys you pass into `gauge.show` plus
|
||||||
|
any keys you have on a custom theme.
|
||||||
|
* `section` – What big thing you're working on now.
|
||||||
|
* `subsection` – What component of that thing is currently working.
|
||||||
|
* `activityIndicator` – Shows a spinner using the `activityIndicatorTheme`
|
||||||
|
from your active theme.
|
||||||
|
* `progressbar` – A progress bar representing your current `completed`
|
||||||
|
using the `progressbarTheme` from your active theme.
|
||||||
|
* *kerning* – Number of spaces that must be between this item and other
|
||||||
|
items, if this item is displayed at all.
|
||||||
|
* *maxLength* – The maximum length for this element. If its value is longer it
|
||||||
|
will be truncated.
|
||||||
|
* *minLength* – The minimum length for this element. If its value is shorter it
|
||||||
|
will be padded according to the *align* value.
|
||||||
|
* *align* – (Default: left) Possible values "left", "right" and "center". Works
|
||||||
|
as you'd expect from word processors.
|
||||||
|
* *length* – Provides a single value for both *minLength* and *maxLength*. If both
|
||||||
|
*length* and *minLength or *maxLength* are specified then the latter take precedence.
|
||||||
|
* *value* – A literal value to use for this template item.
|
||||||
|
* *default* – A default value to use for this template item if a value
|
||||||
|
wasn't otherwise passed in.
|
||||||
|
|
||||||
|
### PLUMBING
|
||||||
|
|
||||||
|
This is the super simple, assume nothing, do no magic internals used by gauge to
|
||||||
|
implement its ordinary interface.
|
||||||
|
|
||||||
|
```
|
||||||
|
var Plumbing = require('gauge/plumbing')
|
||||||
|
var gauge = new Plumbing(theme, template, width)
|
||||||
|
```
|
||||||
|
|
||||||
|
* **theme**: The theme to use.
|
||||||
|
* **template**: The template to use.
|
||||||
|
* **width**: How wide your gauge should be
|
||||||
|
|
||||||
|
#### `gauge.setTheme(theme)`
|
||||||
|
|
||||||
|
Change the active theme.
|
||||||
|
|
||||||
|
#### `gauge.setTemplate(template)`
|
||||||
|
|
||||||
|
Change the active template.
|
||||||
|
|
||||||
|
#### `gauge.setWidth(width)`
|
||||||
|
|
||||||
|
Change the width to render at.
|
||||||
|
|
||||||
|
#### `gauge.hide()`
|
||||||
|
|
||||||
|
Return the string necessary to hide the progress bar
|
||||||
|
|
||||||
|
#### `gauge.hideCursor()`
|
||||||
|
|
||||||
|
Return a string to hide the cursor.
|
||||||
|
|
||||||
|
#### `gauge.showCursor()`
|
||||||
|
|
||||||
|
Return a string to show the cursor.
|
||||||
|
|
||||||
|
#### `gauge.show(status)`
|
||||||
|
|
||||||
|
Using `status` for values, render the provided template with the theme and return
|
||||||
|
a string that is suitable for printing to update the gauge.
|
66
mybulma/node_modules/gauge/package.json
generated
vendored
Normal file
66
mybulma/node_modules/gauge/package.json
generated
vendored
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
{
|
||||||
|
"name": "gauge",
|
||||||
|
"version": "4.0.4",
|
||||||
|
"description": "A terminal based horizontal gauge",
|
||||||
|
"main": "lib",
|
||||||
|
"scripts": {
|
||||||
|
"test": "tap",
|
||||||
|
"lint": "eslint \"**/*.js\"",
|
||||||
|
"postlint": "template-oss-check",
|
||||||
|
"lintfix": "npm run lint -- --fix",
|
||||||
|
"preversion": "npm test",
|
||||||
|
"postversion": "npm publish",
|
||||||
|
"prepublishOnly": "git push origin --follow-tags",
|
||||||
|
"snap": "tap",
|
||||||
|
"posttest": "npm run lint",
|
||||||
|
"template-oss-apply": "template-oss-apply --force"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/npm/gauge.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"progressbar",
|
||||||
|
"progress",
|
||||||
|
"gauge"
|
||||||
|
],
|
||||||
|
"author": "GitHub Inc.",
|
||||||
|
"license": "ISC",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/npm/gauge/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/npm/gauge",
|
||||||
|
"dependencies": {
|
||||||
|
"aproba": "^1.0.3 || ^2.0.0",
|
||||||
|
"color-support": "^1.1.3",
|
||||||
|
"console-control-strings": "^1.1.0",
|
||||||
|
"has-unicode": "^2.0.1",
|
||||||
|
"signal-exit": "^3.0.7",
|
||||||
|
"string-width": "^4.2.3",
|
||||||
|
"strip-ansi": "^6.0.1",
|
||||||
|
"wide-align": "^1.1.5"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@npmcli/eslint-config": "^3.0.1",
|
||||||
|
"@npmcli/template-oss": "3.2.0",
|
||||||
|
"readable-stream": "^3.6.0",
|
||||||
|
"tap": "^16.0.1"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"bin/",
|
||||||
|
"lib/"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
|
||||||
|
},
|
||||||
|
"tap": {
|
||||||
|
"branches": 79,
|
||||||
|
"statements": 89,
|
||||||
|
"functions": 92,
|
||||||
|
"lines": 90
|
||||||
|
},
|
||||||
|
"templateOSS": {
|
||||||
|
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
||||||
|
"version": "3.2.0"
|
||||||
|
}
|
||||||
|
}
|
22
mybulma/node_modules/gaze/LICENSE-MIT
generated
vendored
Normal file
22
mybulma/node_modules/gaze/LICENSE-MIT
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
Copyright (c) 2018 Kyle Robinson Young
|
||||||
|
|
||||||
|
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.
|
196
mybulma/node_modules/gaze/README.md
generated
vendored
Normal file
196
mybulma/node_modules/gaze/README.md
generated
vendored
Normal file
|
@ -0,0 +1,196 @@
|
||||||
|
# gaze [![Build Status](http://img.shields.io/travis/shama/gaze.svg)](https://travis-ci.org/shama/gaze) [![Build status](https://ci.appveyor.com/api/projects/status/vtx65w9eg511tgo4)](https://ci.appveyor.com/project/shama/gaze)
|
||||||
|
|
||||||
|
A globbing `fs.watch` wrapper built from the best parts of other fine watch libs.
|
||||||
|
Compatible with Node.js >= 4.x, Windows, macOS, and Linux.
|
||||||
|
|
||||||
|
![gaze](http://dontkry.com/images/repos/gaze.png)
|
||||||
|
|
||||||
|
[![NPM](https://nodei.co/npm/gaze.png?downloads=true)](https://nodei.co/npm/gaze/)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
Install the module with: `npm install gaze` or place into your `package.json`
|
||||||
|
and run `npm install`.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var gaze = require('gaze');
|
||||||
|
|
||||||
|
// Watch all .js files/dirs in process.cwd()
|
||||||
|
gaze('**/*.js', function(err, watcher) {
|
||||||
|
// Files have all started watching
|
||||||
|
// watcher === this
|
||||||
|
|
||||||
|
// Get all watched files
|
||||||
|
var watched = this.watched();
|
||||||
|
|
||||||
|
// On file changed
|
||||||
|
this.on('changed', function(filepath) {
|
||||||
|
console.log(filepath + ' was changed');
|
||||||
|
});
|
||||||
|
|
||||||
|
// On file added
|
||||||
|
this.on('added', function(filepath) {
|
||||||
|
console.log(filepath + ' was added');
|
||||||
|
});
|
||||||
|
|
||||||
|
// On file deleted
|
||||||
|
this.on('deleted', function(filepath) {
|
||||||
|
console.log(filepath + ' was deleted');
|
||||||
|
});
|
||||||
|
|
||||||
|
// On changed/added/deleted
|
||||||
|
this.on('all', function(event, filepath) {
|
||||||
|
console.log(filepath + ' was ' + event);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Get watched files with relative paths
|
||||||
|
var files = this.relative();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Also accepts an array of patterns
|
||||||
|
gaze(['stylesheets/*.css', 'images/**/*.png'], function() {
|
||||||
|
// Add more patterns later to be watched
|
||||||
|
this.add(['js/*.js']);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Alternate Interface
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var Gaze = require('gaze').Gaze;
|
||||||
|
|
||||||
|
var gaze = new Gaze('**/*');
|
||||||
|
|
||||||
|
// Files have all started watching
|
||||||
|
gaze.on('ready', function(watcher) { });
|
||||||
|
|
||||||
|
// A file has been added/changed/deleted has occurred
|
||||||
|
gaze.on('all', function(event, filepath) { });
|
||||||
|
```
|
||||||
|
|
||||||
|
### Errors
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
gaze('**/*', function(error, watcher) {
|
||||||
|
if (error) {
|
||||||
|
// Handle error if it occurred while starting up
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Or with the alternative interface
|
||||||
|
var gaze = new Gaze();
|
||||||
|
gaze.on('error', function(error) {
|
||||||
|
// Handle error here
|
||||||
|
});
|
||||||
|
gaze.add('**/*');
|
||||||
|
```
|
||||||
|
|
||||||
|
### Minimatch / Glob
|
||||||
|
|
||||||
|
See [isaacs's `minimatch`](https://github.com/isaacs/minimatch) for more
|
||||||
|
information on glob patterns.
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
### gaze([patterns, options, callback])
|
||||||
|
|
||||||
|
* `patterns` {`String`|`Array`} File patterns to be matched
|
||||||
|
* `options` {`Object`}
|
||||||
|
* `callback` {`Function`}
|
||||||
|
* `err` {`Error` | `null`}
|
||||||
|
* `watcher` {`Object`} Instance of the `Gaze` watcher
|
||||||
|
|
||||||
|
### Class: `gaze.Gaze`
|
||||||
|
|
||||||
|
Create a `Gaze` object by instancing the `gaze.Gaze` class.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var Gaze = require('gaze').Gaze;
|
||||||
|
var gaze = new Gaze(pattern, options, callback);
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Properties
|
||||||
|
|
||||||
|
* `options` The options object passed in.
|
||||||
|
* `interval` {integer} Interval to pass to `fs.watchFile`
|
||||||
|
* `debounceDelay` {integer} Delay for events called in succession for the same
|
||||||
|
file/event in milliseconds
|
||||||
|
* `mode` {string} Force the watch mode. Either `'auto'` (default), `'watch'` (force native events), or `'poll'` (force stat polling).
|
||||||
|
* `cwd` {string} The current working directory to base file patterns from. Default is `process.cwd()`.
|
||||||
|
|
||||||
|
#### Events
|
||||||
|
|
||||||
|
* `ready(watcher)` When files have been globbed and watching has begun.
|
||||||
|
* `all(event, filepath)` When an `added`, `changed`, `renamed`, or `deleted` event occurs.
|
||||||
|
* `added(filepath)` When a file has been added to a watch directory.
|
||||||
|
* `changed(filepath)` When a file has been changed.
|
||||||
|
* `deleted(filepath)` When a file has been deleted.
|
||||||
|
* `renamed(newPath, oldPath)` When a file has been renamed.
|
||||||
|
* `end()` When the watcher is closed and watches have been removed.
|
||||||
|
* `error(err)` When an error occurs.
|
||||||
|
* `nomatch` When no files have been matched.
|
||||||
|
|
||||||
|
#### Methods
|
||||||
|
|
||||||
|
* `emit(event, [...])` Wrapper for `EventEmitter.emit`.
|
||||||
|
`added`|`changed`|`renamed`|`deleted` events will also trigger the `all` event.
|
||||||
|
* `close()` Unwatch all files and reset the watch instance.
|
||||||
|
* `add(patterns, callback)` Adds file(s) `patterns` to be watched.
|
||||||
|
* `remove(filepath)` Removes a file or directory from being watched. Does not
|
||||||
|
recurse directories.
|
||||||
|
* `watched()` Returns the currently watched files.
|
||||||
|
* `relative([dir, unixify])` Returns the currently watched files with relative paths.
|
||||||
|
* `dir` {string} Only return relative files for this directory.
|
||||||
|
* `unixify` {boolean} Return paths with `/` instead of `\\` if on Windows.
|
||||||
|
|
||||||
|
## Similar Projects
|
||||||
|
|
||||||
|
Other great watch libraries to try are:
|
||||||
|
|
||||||
|
* [paulmillr's `chokidar`](https://github.com/paulmillr/chokidar)
|
||||||
|
* [amasad's `sane`](https://github.com/amasad/sane)
|
||||||
|
* [mikeal's `watch`](https://github.com/mikeal/watch)
|
||||||
|
* [github's `pathwatcher`](https://github.com/atom/node-pathwatcher)
|
||||||
|
* [bevry's `watchr`](https://github.com/bevry/watchr)
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
In lieu of a formal styleguide, take care to maintain the existing coding style.
|
||||||
|
Add unit tests for any new or changed functionality. Lint and test your code
|
||||||
|
using [grunt](http://gruntjs.com/).
|
||||||
|
|
||||||
|
## Release History
|
||||||
|
* 1.1.3 - Fix for Node 10 support (@aredridel). Officially dropping support for Node < 4.
|
||||||
|
* 1.1.2 - Prevent more `ENOENT` errors from escaping (@alexgorbatchev).
|
||||||
|
* 1.1.1 - Prevent `fs.watch` errors from escaping error handler (@rosen-vladimirov). Fix `_addToWatched` without `path.sep` (@wyicwx).
|
||||||
|
* 1.1.0 - Update to `globule@1.0.0` with `minimatch >= 3.0.0`.
|
||||||
|
* 1.0.0 - Revert back to 0.5.2. Drop support for Node.js v0.8. Fix for `maxListeners`. Update `globule` to `0.2.0`.
|
||||||
|
* 0.6.4 - Catch and emit `error` from `readdir` (@oconnore). Fix for `0 maxListeners`. Use `graceful-fs` to avoid `EMFILE` errors in other places `fs` is used. Better method to determine if `pathwatcher` was built. Fix keeping process alive too much, only init `pathwatcher` if a file is being watched. Set min required to Windows Vista when building on Windows (@pvolok).
|
||||||
|
* 0.6.3 - Add support for Node.js v0.11
|
||||||
|
* 0.6.2 - Fix argument error with `watched()`. Fix for erroneous `added` events on folders. Ignore `msvs` build error 4244.
|
||||||
|
* 0.6.1 - Fix for absolute paths.
|
||||||
|
* 0.6.0 - Uses native OS events (fork of `pathwatcher`) but can fall back to stat polling. Everything is async to avoid blocking, including `relative()` and `watched()`. Better error handling. Update to `globule@0.2.0`. No longer watches `cwd` by default. Added `mode` option. Better `EMFILE` message. Avoids `ENOENT` errors with symlinks. All constructor arguments are optional.
|
||||||
|
* 0.5.2 - Fix for `ENOENT` error with non-existent symlinks [BACKPORTED].
|
||||||
|
* 0.5.1 - Use `setImmediate` (`process.nextTick` for Node.js v0.8) to defer `ready`/`nomatch` events (@amasad).
|
||||||
|
* 0.5.0 - Process is now kept alive while watching files. Emits a `nomatch` event when no files are matching.
|
||||||
|
* 0.4.3 - Track file additions in newly created folders (@brett-shwom).
|
||||||
|
* 0.4.2 - Fix `.remove()` method to remove a single file in a directory (@kaelzhang). Fixing “`Cannot call method 'call' of undefined`” (@krasimir). Track new file additions within folders (@brett-shwom).
|
||||||
|
* 0.4.1 - Fix `watchDir` not respecting close in race condition (@chrisirhc).
|
||||||
|
* 0.4.0 - Drop support for Node.js v0.6. Use `globule` for file matching. Avoid Node.js v0.10 `path.resolve`/`join` errors. Register new files when added to non-existent folder. Multiple instances can now poll the same files (@jpommerening).
|
||||||
|
* 0.3.4 - Code clean up. Fix “`path must be strings`” errors (@groner). Fix incorrect `added` events (@groner).
|
||||||
|
* 0.3.3 - Fix for multiple patterns with negate.
|
||||||
|
* 0.3.2 - Emit `end` before `removeAllListeners`.
|
||||||
|
* 0.3.1 - Fix `added` events within subfolder patterns.
|
||||||
|
* 0.3.0 - Handle safewrite events, `forceWatchMethod` option removed, bug fixes and watch optimizations (@rgaskill).
|
||||||
|
* 0.2.2 - Fix issue where subsequent `add` calls dont get watched (@samcday). `removeAllListeners` on `close`.
|
||||||
|
* 0.2.1 - Fix issue with invalid `added` events in current working dir.
|
||||||
|
* 0.2.0 - Support and mark folders with `path.sep`. Add `forceWatchMethod` option. Support `renamed` events.
|
||||||
|
* 0.1.6 - Recognize the `cwd` option properly
|
||||||
|
* 0.1.5 - Catch “`too many open file`” errors
|
||||||
|
* 0.1.4 - Really fix the race condition with 2 watches
|
||||||
|
* 0.1.3 - Fix race condition with 2 watches
|
||||||
|
* 0.1.2 - Read triggering changed event fix
|
||||||
|
* 0.1.1 - Minor fixes
|
||||||
|
* 0.1.0 - Initial release
|
||||||
|
|
||||||
|
## License
|
||||||
|
Copyright (c) 2018 Kyle Robinson Young
|
||||||
|
Licensed under the MIT license.
|
54
mybulma/node_modules/gaze/package.json
generated
vendored
Normal file
54
mybulma/node_modules/gaze/package.json
generated
vendored
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
"name": "gaze",
|
||||||
|
"description": "A globbing fs.watch wrapper built from the best parts of other fine watch libs.",
|
||||||
|
"version": "1.1.3",
|
||||||
|
"homepage": "https://github.com/shama/gaze",
|
||||||
|
"author": {
|
||||||
|
"name": "Kyle Robinson Young",
|
||||||
|
"email": "kyle@dontkry.com"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/shama/gaze.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/shama/gaze/issues"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "lib/gaze",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 4.0.0"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "semistandard && grunt nodeunit -v"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"globule": "^1.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"async": "^2.6.1",
|
||||||
|
"grunt": "^1.0.1",
|
||||||
|
"grunt-benchmark": "^1.0.0",
|
||||||
|
"grunt-cli": "^1.2.0",
|
||||||
|
"grunt-contrib-jshint": "^1.1.0",
|
||||||
|
"grunt-contrib-nodeunit": "^2.0.0",
|
||||||
|
"rimraf": "^2.5.2",
|
||||||
|
"semistandard": "^12.0.1"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"watch",
|
||||||
|
"glob"
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
"lib",
|
||||||
|
"LICENSE-MIT"
|
||||||
|
],
|
||||||
|
"semistandard": {
|
||||||
|
"ignore": [
|
||||||
|
"benchmarks",
|
||||||
|
"experiments",
|
||||||
|
"build",
|
||||||
|
"test"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
6
mybulma/node_modules/get-caller-file/LICENSE.md
generated
vendored
Normal file
6
mybulma/node_modules/get-caller-file/LICENSE.md
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
ISC License (ISC)
|
||||||
|
Copyright 2018 Stefan Penner
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
41
mybulma/node_modules/get-caller-file/README.md
generated
vendored
Normal file
41
mybulma/node_modules/get-caller-file/README.md
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
# get-caller-file
|
||||||
|
|
||||||
|
[![Build Status](https://travis-ci.org/stefanpenner/get-caller-file.svg?branch=master)](https://travis-ci.org/stefanpenner/get-caller-file)
|
||||||
|
[![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master)
|
||||||
|
|
||||||
|
This is a utility, which allows a function to figure out from which file it was invoked. It does so by inspecting v8's stack trace at the time it is invoked.
|
||||||
|
|
||||||
|
Inspired by http://stackoverflow.com/questions/13227489
|
||||||
|
|
||||||
|
*note: this relies on Node/V8 specific APIs, as such other runtimes may not work*
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn add get-caller-file
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Given:
|
||||||
|
|
||||||
|
```js
|
||||||
|
// ./foo.js
|
||||||
|
const getCallerFile = require('get-caller-file');
|
||||||
|
|
||||||
|
module.exports = function() {
|
||||||
|
return getCallerFile(); // figures out who called it
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
// index.js
|
||||||
|
const foo = require('./foo');
|
||||||
|
|
||||||
|
foo() // => /full/path/to/this/file/index.js
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Options:
|
||||||
|
|
||||||
|
* `getCallerFile(position = 2)`: where position is stack frame whos fileName we want.
|
2
mybulma/node_modules/get-caller-file/index.d.ts
generated
vendored
Normal file
2
mybulma/node_modules/get-caller-file/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
declare const _default: (position?: number) => any;
|
||||||
|
export = _default;
|
22
mybulma/node_modules/get-caller-file/index.js
generated
vendored
Normal file
22
mybulma/node_modules/get-caller-file/index.js
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
"use strict";
|
||||||
|
// Call this function in a another function to find out the file from
|
||||||
|
// which that function was called from. (Inspects the v8 stack trace)
|
||||||
|
//
|
||||||
|
// Inspired by http://stackoverflow.com/questions/13227489
|
||||||
|
module.exports = function getCallerFile(position) {
|
||||||
|
if (position === void 0) { position = 2; }
|
||||||
|
if (position >= Error.stackTraceLimit) {
|
||||||
|
throw new TypeError('getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `' + position + '` and Error.stackTraceLimit was: `' + Error.stackTraceLimit + '`');
|
||||||
|
}
|
||||||
|
var oldPrepareStackTrace = Error.prepareStackTrace;
|
||||||
|
Error.prepareStackTrace = function (_, stack) { return stack; };
|
||||||
|
var stack = new Error().stack;
|
||||||
|
Error.prepareStackTrace = oldPrepareStackTrace;
|
||||||
|
if (stack !== null && typeof stack === 'object') {
|
||||||
|
// stack[0] holds this file
|
||||||
|
// stack[1] holds where this function was called
|
||||||
|
// stack[2] holds the file we're interested in
|
||||||
|
return stack[position] ? stack[position].getFileName() : undefined;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//# sourceMappingURL=index.js.map
|
1
mybulma/node_modules/get-caller-file/index.js.map
generated
vendored
Normal file
1
mybulma/node_modules/get-caller-file/index.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,qEAAqE;AACrE,EAAE;AACF,0DAA0D;AAE1D,iBAAS,SAAS,aAAa,CAAC,QAAY;IAAZ,yBAAA,EAAA,YAAY;IAC1C,IAAI,QAAQ,IAAI,KAAK,CAAC,eAAe,EAAE;QACrC,MAAM,IAAI,SAAS,CAAC,kGAAkG,GAAG,QAAQ,GAAG,oCAAoC,GAAG,KAAK,CAAC,eAAe,GAAG,GAAG,CAAC,CAAC;KACzM;IAED,IAAM,oBAAoB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACrD,KAAK,CAAC,iBAAiB,GAAG,UAAC,CAAC,EAAE,KAAK,IAAM,OAAA,KAAK,EAAL,CAAK,CAAC;IAC/C,IAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC;IAChC,KAAK,CAAC,iBAAiB,GAAG,oBAAoB,CAAC;IAG/C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC/C,2BAA2B;QAC3B,gDAAgD;QAChD,8CAA8C;QAC9C,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAE,KAAK,CAAC,QAAQ,CAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;KAC7E;AACH,CAAC,CAAC"}
|
42
mybulma/node_modules/get-caller-file/package.json
generated
vendored
Normal file
42
mybulma/node_modules/get-caller-file/package.json
generated
vendored
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
{
|
||||||
|
"name": "get-caller-file",
|
||||||
|
"version": "2.0.5",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"directories": {
|
||||||
|
"test": "tests"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"index.js",
|
||||||
|
"index.js.map",
|
||||||
|
"index.d.ts"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"prepare": "tsc",
|
||||||
|
"test": "mocha test",
|
||||||
|
"test:debug": "mocha test"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/stefanpenner/get-caller-file.git"
|
||||||
|
},
|
||||||
|
"author": "Stefan Penner",
|
||||||
|
"license": "ISC",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/stefanpenner/get-caller-file/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/stefanpenner/get-caller-file#readme",
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/chai": "^4.1.7",
|
||||||
|
"@types/ensure-posix-path": "^1.0.0",
|
||||||
|
"@types/mocha": "^5.2.6",
|
||||||
|
"@types/node": "^11.10.5",
|
||||||
|
"chai": "^4.1.2",
|
||||||
|
"ensure-posix-path": "^1.0.1",
|
||||||
|
"mocha": "^5.2.0",
|
||||||
|
"typescript": "^3.3.3333"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "6.* || 8.* || >= 10.*"
|
||||||
|
}
|
||||||
|
}
|
21
mybulma/node_modules/glob/LICENSE
generated
vendored
Normal file
21
mybulma/node_modules/glob/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
The ISC License
|
||||||
|
|
||||||
|
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||||
|
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
## Glob Logo
|
||||||
|
|
||||||
|
Glob's logo created by Tanya Brassie <http://tanyabrassie.com/>, licensed
|
||||||
|
under a Creative Commons Attribution-ShareAlike 4.0 International License
|
||||||
|
https://creativecommons.org/licenses/by-sa/4.0/
|
378
mybulma/node_modules/glob/README.md
generated
vendored
Normal file
378
mybulma/node_modules/glob/README.md
generated
vendored
Normal file
|
@ -0,0 +1,378 @@
|
||||||
|
# Glob
|
||||||
|
|
||||||
|
Match files using the patterns the shell uses, like stars and stuff.
|
||||||
|
|
||||||
|
[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master)
|
||||||
|
|
||||||
|
This is a glob implementation in JavaScript. It uses the `minimatch`
|
||||||
|
library to do its matching.
|
||||||
|
|
||||||
|
![a fun cartoon logo made of glob characters](logo/glob.png)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Install with npm
|
||||||
|
|
||||||
|
```
|
||||||
|
npm i glob
|
||||||
|
```
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var glob = require("glob")
|
||||||
|
|
||||||
|
// options is optional
|
||||||
|
glob("**/*.js", options, function (er, files) {
|
||||||
|
// files is an array of filenames.
|
||||||
|
// If the `nonull` option is set, and nothing
|
||||||
|
// was found, then files is ["**/*.js"]
|
||||||
|
// er is an error object or null.
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
## Glob Primer
|
||||||
|
|
||||||
|
"Globs" are the patterns you type when you do stuff like `ls *.js` on
|
||||||
|
the command line, or put `build/*` in a `.gitignore` file.
|
||||||
|
|
||||||
|
Before parsing the path part patterns, braced sections are expanded
|
||||||
|
into a set. Braced sections start with `{` and end with `}`, with any
|
||||||
|
number of comma-delimited sections within. Braced sections may contain
|
||||||
|
slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.
|
||||||
|
|
||||||
|
The following characters have special magic meaning when used in a
|
||||||
|
path portion:
|
||||||
|
|
||||||
|
* `*` Matches 0 or more characters in a single path portion
|
||||||
|
* `?` Matches 1 character
|
||||||
|
* `[...]` Matches a range of characters, similar to a RegExp range.
|
||||||
|
If the first character of the range is `!` or `^` then it matches
|
||||||
|
any character not in the range.
|
||||||
|
* `!(pattern|pattern|pattern)` Matches anything that does not match
|
||||||
|
any of the patterns provided.
|
||||||
|
* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the
|
||||||
|
patterns provided.
|
||||||
|
* `+(pattern|pattern|pattern)` Matches one or more occurrences of the
|
||||||
|
patterns provided.
|
||||||
|
* `*(a|b|c)` Matches zero or more occurrences of the patterns provided
|
||||||
|
* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns
|
||||||
|
provided
|
||||||
|
* `**` If a "globstar" is alone in a path portion, then it matches
|
||||||
|
zero or more directories and subdirectories searching for matches.
|
||||||
|
It does not crawl symlinked directories.
|
||||||
|
|
||||||
|
### Dots
|
||||||
|
|
||||||
|
If a file or directory path portion has a `.` as the first character,
|
||||||
|
then it will not match any glob pattern unless that pattern's
|
||||||
|
corresponding path part also has a `.` as its first character.
|
||||||
|
|
||||||
|
For example, the pattern `a/.*/c` would match the file at `a/.b/c`.
|
||||||
|
However the pattern `a/*/c` would not, because `*` does not start with
|
||||||
|
a dot character.
|
||||||
|
|
||||||
|
You can make glob treat dots as normal characters by setting
|
||||||
|
`dot:true` in the options.
|
||||||
|
|
||||||
|
### Basename Matching
|
||||||
|
|
||||||
|
If you set `matchBase:true` in the options, and the pattern has no
|
||||||
|
slashes in it, then it will seek for any file anywhere in the tree
|
||||||
|
with a matching basename. For example, `*.js` would match
|
||||||
|
`test/simple/basic.js`.
|
||||||
|
|
||||||
|
### Empty Sets
|
||||||
|
|
||||||
|
If no matching files are found, then an empty array is returned. This
|
||||||
|
differs from the shell, where the pattern itself is returned. For
|
||||||
|
example:
|
||||||
|
|
||||||
|
$ echo a*s*d*f
|
||||||
|
a*s*d*f
|
||||||
|
|
||||||
|
To get the bash-style behavior, set the `nonull:true` in the options.
|
||||||
|
|
||||||
|
### See Also:
|
||||||
|
|
||||||
|
* `man sh`
|
||||||
|
* `man bash` (Search for "Pattern Matching")
|
||||||
|
* `man 3 fnmatch`
|
||||||
|
* `man 5 gitignore`
|
||||||
|
* [minimatch documentation](https://github.com/isaacs/minimatch)
|
||||||
|
|
||||||
|
## glob.hasMagic(pattern, [options])
|
||||||
|
|
||||||
|
Returns `true` if there are any special characters in the pattern, and
|
||||||
|
`false` otherwise.
|
||||||
|
|
||||||
|
Note that the options affect the results. If `noext:true` is set in
|
||||||
|
the options object, then `+(a|b)` will not be considered a magic
|
||||||
|
pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}`
|
||||||
|
then that is considered magical, unless `nobrace:true` is set in the
|
||||||
|
options.
|
||||||
|
|
||||||
|
## glob(pattern, [options], cb)
|
||||||
|
|
||||||
|
* `pattern` `{String}` Pattern to be matched
|
||||||
|
* `options` `{Object}`
|
||||||
|
* `cb` `{Function}`
|
||||||
|
* `err` `{Error | null}`
|
||||||
|
* `matches` `{Array<String>}` filenames found matching the pattern
|
||||||
|
|
||||||
|
Perform an asynchronous glob search.
|
||||||
|
|
||||||
|
## glob.sync(pattern, [options])
|
||||||
|
|
||||||
|
* `pattern` `{String}` Pattern to be matched
|
||||||
|
* `options` `{Object}`
|
||||||
|
* return: `{Array<String>}` filenames found matching the pattern
|
||||||
|
|
||||||
|
Perform a synchronous glob search.
|
||||||
|
|
||||||
|
## Class: glob.Glob
|
||||||
|
|
||||||
|
Create a Glob object by instantiating the `glob.Glob` class.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var Glob = require("glob").Glob
|
||||||
|
var mg = new Glob(pattern, options, cb)
|
||||||
|
```
|
||||||
|
|
||||||
|
It's an EventEmitter, and starts walking the filesystem to find matches
|
||||||
|
immediately.
|
||||||
|
|
||||||
|
### new glob.Glob(pattern, [options], [cb])
|
||||||
|
|
||||||
|
* `pattern` `{String}` pattern to search for
|
||||||
|
* `options` `{Object}`
|
||||||
|
* `cb` `{Function}` Called when an error occurs, or matches are found
|
||||||
|
* `err` `{Error | null}`
|
||||||
|
* `matches` `{Array<String>}` filenames found matching the pattern
|
||||||
|
|
||||||
|
Note that if the `sync` flag is set in the options, then matches will
|
||||||
|
be immediately available on the `g.found` member.
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
* `minimatch` The minimatch object that the glob uses.
|
||||||
|
* `options` The options object passed in.
|
||||||
|
* `aborted` Boolean which is set to true when calling `abort()`. There
|
||||||
|
is no way at this time to continue a glob search after aborting, but
|
||||||
|
you can re-use the statCache to avoid having to duplicate syscalls.
|
||||||
|
* `cache` Convenience object. Each field has the following possible
|
||||||
|
values:
|
||||||
|
* `false` - Path does not exist
|
||||||
|
* `true` - Path exists
|
||||||
|
* `'FILE'` - Path exists, and is not a directory
|
||||||
|
* `'DIR'` - Path exists, and is a directory
|
||||||
|
* `[file, entries, ...]` - Path exists, is a directory, and the
|
||||||
|
array value is the results of `fs.readdir`
|
||||||
|
* `statCache` Cache of `fs.stat` results, to prevent statting the same
|
||||||
|
path multiple times.
|
||||||
|
* `symlinks` A record of which paths are symbolic links, which is
|
||||||
|
relevant in resolving `**` patterns.
|
||||||
|
* `realpathCache` An optional object which is passed to `fs.realpath`
|
||||||
|
to minimize unnecessary syscalls. It is stored on the instantiated
|
||||||
|
Glob object, and may be re-used.
|
||||||
|
|
||||||
|
### Events
|
||||||
|
|
||||||
|
* `end` When the matching is finished, this is emitted with all the
|
||||||
|
matches found. If the `nonull` option is set, and no match was found,
|
||||||
|
then the `matches` list contains the original pattern. The matches
|
||||||
|
are sorted, unless the `nosort` flag is set.
|
||||||
|
* `match` Every time a match is found, this is emitted with the specific
|
||||||
|
thing that matched. It is not deduplicated or resolved to a realpath.
|
||||||
|
* `error` Emitted when an unexpected error is encountered, or whenever
|
||||||
|
any fs error occurs if `options.strict` is set.
|
||||||
|
* `abort` When `abort()` is called, this event is raised.
|
||||||
|
|
||||||
|
### Methods
|
||||||
|
|
||||||
|
* `pause` Temporarily stop the search
|
||||||
|
* `resume` Resume the search
|
||||||
|
* `abort` Stop the search forever
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
All the options that can be passed to Minimatch can also be passed to
|
||||||
|
Glob to change pattern matching behavior. Also, some have been added,
|
||||||
|
or have glob-specific ramifications.
|
||||||
|
|
||||||
|
All options are false by default, unless otherwise noted.
|
||||||
|
|
||||||
|
All options are added to the Glob object, as well.
|
||||||
|
|
||||||
|
If you are running many `glob` operations, you can pass a Glob object
|
||||||
|
as the `options` argument to a subsequent operation to shortcut some
|
||||||
|
`stat` and `readdir` calls. At the very least, you may pass in shared
|
||||||
|
`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that
|
||||||
|
parallel glob operations will be sped up by sharing information about
|
||||||
|
the filesystem.
|
||||||
|
|
||||||
|
* `cwd` The current working directory in which to search. Defaults
|
||||||
|
to `process.cwd()`.
|
||||||
|
* `root` The place where patterns starting with `/` will be mounted
|
||||||
|
onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix
|
||||||
|
systems, and `C:\` or some such on Windows.)
|
||||||
|
* `dot` Include `.dot` files in normal matches and `globstar` matches.
|
||||||
|
Note that an explicit dot in a portion of the pattern will always
|
||||||
|
match dot files.
|
||||||
|
* `nomount` By default, a pattern starting with a forward-slash will be
|
||||||
|
"mounted" onto the root setting, so that a valid filesystem path is
|
||||||
|
returned. Set this flag to disable that behavior.
|
||||||
|
* `mark` Add a `/` character to directory matches. Note that this
|
||||||
|
requires additional stat calls.
|
||||||
|
* `nosort` Don't sort the results.
|
||||||
|
* `stat` Set to true to stat *all* results. This reduces performance
|
||||||
|
somewhat, and is completely unnecessary, unless `readdir` is presumed
|
||||||
|
to be an untrustworthy indicator of file existence.
|
||||||
|
* `silent` When an unusual error is encountered when attempting to
|
||||||
|
read a directory, a warning will be printed to stderr. Set the
|
||||||
|
`silent` option to true to suppress these warnings.
|
||||||
|
* `strict` When an unusual error is encountered when attempting to
|
||||||
|
read a directory, the process will just continue on in search of
|
||||||
|
other matches. Set the `strict` option to raise an error in these
|
||||||
|
cases.
|
||||||
|
* `cache` See `cache` property above. Pass in a previously generated
|
||||||
|
cache object to save some fs calls.
|
||||||
|
* `statCache` A cache of results of filesystem information, to prevent
|
||||||
|
unnecessary stat calls. While it should not normally be necessary
|
||||||
|
to set this, you may pass the statCache from one glob() call to the
|
||||||
|
options object of another, if you know that the filesystem will not
|
||||||
|
change between calls. (See "Race Conditions" below.)
|
||||||
|
* `symlinks` A cache of known symbolic links. You may pass in a
|
||||||
|
previously generated `symlinks` object to save `lstat` calls when
|
||||||
|
resolving `**` matches.
|
||||||
|
* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.
|
||||||
|
* `nounique` In some cases, brace-expanded patterns can result in the
|
||||||
|
same file showing up multiple times in the result set. By default,
|
||||||
|
this implementation prevents duplicates in the result set. Set this
|
||||||
|
flag to disable that behavior.
|
||||||
|
* `nonull` Set to never return an empty set, instead returning a set
|
||||||
|
containing the pattern itself. This is the default in glob(3).
|
||||||
|
* `debug` Set to enable debug logging in minimatch and glob.
|
||||||
|
* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.
|
||||||
|
* `noglobstar` Do not match `**` against multiple filenames. (Ie,
|
||||||
|
treat it as a normal `*` instead.)
|
||||||
|
* `noext` Do not match `+(a|b)` "extglob" patterns.
|
||||||
|
* `nocase` Perform a case-insensitive match. Note: on
|
||||||
|
case-insensitive filesystems, non-magic patterns will match by
|
||||||
|
default, since `stat` and `readdir` will not raise errors.
|
||||||
|
* `matchBase` Perform a basename-only match if the pattern does not
|
||||||
|
contain any slash characters. That is, `*.js` would be treated as
|
||||||
|
equivalent to `**/*.js`, matching all js files in all directories.
|
||||||
|
* `nodir` Do not match directories, only files. (Note: to match
|
||||||
|
*only* directories, simply put a `/` at the end of the pattern.)
|
||||||
|
* `ignore` Add a pattern or an array of glob patterns to exclude matches.
|
||||||
|
Note: `ignore` patterns are *always* in `dot:true` mode, regardless
|
||||||
|
of any other settings.
|
||||||
|
* `follow` Follow symlinked directories when expanding `**` patterns.
|
||||||
|
Note that this can result in a lot of duplicate references in the
|
||||||
|
presence of cyclic links.
|
||||||
|
* `realpath` Set to true to call `fs.realpath` on all of the results.
|
||||||
|
In the case of a symlink that cannot be resolved, the full absolute
|
||||||
|
path to the matched entry is returned (though it will usually be a
|
||||||
|
broken symlink)
|
||||||
|
* `absolute` Set to true to always receive absolute paths for matched
|
||||||
|
files. Unlike `realpath`, this also affects the values returned in
|
||||||
|
the `match` event.
|
||||||
|
* `fs` File-system object with Node's `fs` API. By default, the built-in
|
||||||
|
`fs` module will be used. Set to a volume provided by a library like
|
||||||
|
`memfs` to avoid using the "real" file-system.
|
||||||
|
|
||||||
|
## Comparisons to other fnmatch/glob implementations
|
||||||
|
|
||||||
|
While strict compliance with the existing standards is a worthwhile
|
||||||
|
goal, some discrepancies exist between node-glob and other
|
||||||
|
implementations, and are intentional.
|
||||||
|
|
||||||
|
The double-star character `**` is supported by default, unless the
|
||||||
|
`noglobstar` flag is set. This is supported in the manner of bsdglob
|
||||||
|
and bash 4.3, where `**` only has special significance if it is the only
|
||||||
|
thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but
|
||||||
|
`a/**b` will not.
|
||||||
|
|
||||||
|
Note that symlinked directories are not crawled as part of a `**`,
|
||||||
|
though their contents may match against subsequent portions of the
|
||||||
|
pattern. This prevents infinite loops and duplicates and the like.
|
||||||
|
|
||||||
|
If an escaped pattern has no matches, and the `nonull` flag is set,
|
||||||
|
then glob returns the pattern as-provided, rather than
|
||||||
|
interpreting the character escapes. For example,
|
||||||
|
`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
|
||||||
|
`"*a?"`. This is akin to setting the `nullglob` option in bash, except
|
||||||
|
that it does not resolve escaped pattern characters.
|
||||||
|
|
||||||
|
If brace expansion is not disabled, then it is performed before any
|
||||||
|
other interpretation of the glob pattern. Thus, a pattern like
|
||||||
|
`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
|
||||||
|
**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
|
||||||
|
checked for validity. Since those two are valid, matching proceeds.
|
||||||
|
|
||||||
|
### Comments and Negation
|
||||||
|
|
||||||
|
Previously, this module let you mark a pattern as a "comment" if it
|
||||||
|
started with a `#` character, or a "negated" pattern if it started
|
||||||
|
with a `!` character.
|
||||||
|
|
||||||
|
These options were deprecated in version 5, and removed in version 6.
|
||||||
|
|
||||||
|
To specify things that should not match, use the `ignore` option.
|
||||||
|
|
||||||
|
## Windows
|
||||||
|
|
||||||
|
**Please only use forward-slashes in glob expressions.**
|
||||||
|
|
||||||
|
Though windows uses either `/` or `\` as its path separator, only `/`
|
||||||
|
characters are used by this glob implementation. You must use
|
||||||
|
forward-slashes **only** in glob expressions. Back-slashes will always
|
||||||
|
be interpreted as escape characters, not path separators.
|
||||||
|
|
||||||
|
Results from absolute patterns such as `/foo/*` are mounted onto the
|
||||||
|
root setting using `path.join`. On windows, this will by default result
|
||||||
|
in `/foo/*` matching `C:\foo\bar.txt`.
|
||||||
|
|
||||||
|
## Race Conditions
|
||||||
|
|
||||||
|
Glob searching, by its very nature, is susceptible to race conditions,
|
||||||
|
since it relies on directory walking and such.
|
||||||
|
|
||||||
|
As a result, it is possible that a file that exists when glob looks for
|
||||||
|
it may have been deleted or modified by the time it returns the result.
|
||||||
|
|
||||||
|
As part of its internal implementation, this program caches all stat
|
||||||
|
and readdir calls that it makes, in order to cut down on system
|
||||||
|
overhead. However, this also makes it even more susceptible to races,
|
||||||
|
especially if the cache or statCache objects are reused between glob
|
||||||
|
calls.
|
||||||
|
|
||||||
|
Users are thus advised not to use a glob result as a guarantee of
|
||||||
|
filesystem state in the face of rapid changes. For the vast majority
|
||||||
|
of operations, this is never a problem.
|
||||||
|
|
||||||
|
## Glob Logo
|
||||||
|
Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo).
|
||||||
|
|
||||||
|
The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/).
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
Any change to behavior (including bugfixes) must come with a test.
|
||||||
|
|
||||||
|
Patches that fail tests or reduce performance will be rejected.
|
||||||
|
|
||||||
|
```
|
||||||
|
# to run tests
|
||||||
|
npm test
|
||||||
|
|
||||||
|
# to re-generate test fixtures
|
||||||
|
npm run test-regen
|
||||||
|
|
||||||
|
# to benchmark against bash/zsh
|
||||||
|
npm run bench
|
||||||
|
|
||||||
|
# to profile javascript
|
||||||
|
npm run prof
|
||||||
|
```
|
||||||
|
|
||||||
|
![](oh-my-glob.gif)
|
238
mybulma/node_modules/glob/common.js
generated
vendored
Normal file
238
mybulma/node_modules/glob/common.js
generated
vendored
Normal file
|
@ -0,0 +1,238 @@
|
||||||
|
exports.setopts = setopts
|
||||||
|
exports.ownProp = ownProp
|
||||||
|
exports.makeAbs = makeAbs
|
||||||
|
exports.finish = finish
|
||||||
|
exports.mark = mark
|
||||||
|
exports.isIgnored = isIgnored
|
||||||
|
exports.childrenIgnored = childrenIgnored
|
||||||
|
|
||||||
|
function ownProp (obj, field) {
|
||||||
|
return Object.prototype.hasOwnProperty.call(obj, field)
|
||||||
|
}
|
||||||
|
|
||||||
|
var fs = require("fs")
|
||||||
|
var path = require("path")
|
||||||
|
var minimatch = require("minimatch")
|
||||||
|
var isAbsolute = require("path-is-absolute")
|
||||||
|
var Minimatch = minimatch.Minimatch
|
||||||
|
|
||||||
|
function alphasort (a, b) {
|
||||||
|
return a.localeCompare(b, 'en')
|
||||||
|
}
|
||||||
|
|
||||||
|
function setupIgnores (self, options) {
|
||||||
|
self.ignore = options.ignore || []
|
||||||
|
|
||||||
|
if (!Array.isArray(self.ignore))
|
||||||
|
self.ignore = [self.ignore]
|
||||||
|
|
||||||
|
if (self.ignore.length) {
|
||||||
|
self.ignore = self.ignore.map(ignoreMap)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ignore patterns are always in dot:true mode.
|
||||||
|
function ignoreMap (pattern) {
|
||||||
|
var gmatcher = null
|
||||||
|
if (pattern.slice(-3) === '/**') {
|
||||||
|
var gpattern = pattern.replace(/(\/\*\*)+$/, '')
|
||||||
|
gmatcher = new Minimatch(gpattern, { dot: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
matcher: new Minimatch(pattern, { dot: true }),
|
||||||
|
gmatcher: gmatcher
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setopts (self, pattern, options) {
|
||||||
|
if (!options)
|
||||||
|
options = {}
|
||||||
|
|
||||||
|
// base-matching: just use globstar for that.
|
||||||
|
if (options.matchBase && -1 === pattern.indexOf("/")) {
|
||||||
|
if (options.noglobstar) {
|
||||||
|
throw new Error("base matching requires globstar")
|
||||||
|
}
|
||||||
|
pattern = "**/" + pattern
|
||||||
|
}
|
||||||
|
|
||||||
|
self.silent = !!options.silent
|
||||||
|
self.pattern = pattern
|
||||||
|
self.strict = options.strict !== false
|
||||||
|
self.realpath = !!options.realpath
|
||||||
|
self.realpathCache = options.realpathCache || Object.create(null)
|
||||||
|
self.follow = !!options.follow
|
||||||
|
self.dot = !!options.dot
|
||||||
|
self.mark = !!options.mark
|
||||||
|
self.nodir = !!options.nodir
|
||||||
|
if (self.nodir)
|
||||||
|
self.mark = true
|
||||||
|
self.sync = !!options.sync
|
||||||
|
self.nounique = !!options.nounique
|
||||||
|
self.nonull = !!options.nonull
|
||||||
|
self.nosort = !!options.nosort
|
||||||
|
self.nocase = !!options.nocase
|
||||||
|
self.stat = !!options.stat
|
||||||
|
self.noprocess = !!options.noprocess
|
||||||
|
self.absolute = !!options.absolute
|
||||||
|
self.fs = options.fs || fs
|
||||||
|
|
||||||
|
self.maxLength = options.maxLength || Infinity
|
||||||
|
self.cache = options.cache || Object.create(null)
|
||||||
|
self.statCache = options.statCache || Object.create(null)
|
||||||
|
self.symlinks = options.symlinks || Object.create(null)
|
||||||
|
|
||||||
|
setupIgnores(self, options)
|
||||||
|
|
||||||
|
self.changedCwd = false
|
||||||
|
var cwd = process.cwd()
|
||||||
|
if (!ownProp(options, "cwd"))
|
||||||
|
self.cwd = cwd
|
||||||
|
else {
|
||||||
|
self.cwd = path.resolve(options.cwd)
|
||||||
|
self.changedCwd = self.cwd !== cwd
|
||||||
|
}
|
||||||
|
|
||||||
|
self.root = options.root || path.resolve(self.cwd, "/")
|
||||||
|
self.root = path.resolve(self.root)
|
||||||
|
if (process.platform === "win32")
|
||||||
|
self.root = self.root.replace(/\\/g, "/")
|
||||||
|
|
||||||
|
// TODO: is an absolute `cwd` supposed to be resolved against `root`?
|
||||||
|
// e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')
|
||||||
|
self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd)
|
||||||
|
if (process.platform === "win32")
|
||||||
|
self.cwdAbs = self.cwdAbs.replace(/\\/g, "/")
|
||||||
|
self.nomount = !!options.nomount
|
||||||
|
|
||||||
|
// disable comments and negation in Minimatch.
|
||||||
|
// Note that they are not supported in Glob itself anyway.
|
||||||
|
options.nonegate = true
|
||||||
|
options.nocomment = true
|
||||||
|
// always treat \ in patterns as escapes, not path separators
|
||||||
|
options.allowWindowsEscape = false
|
||||||
|
|
||||||
|
self.minimatch = new Minimatch(pattern, options)
|
||||||
|
self.options = self.minimatch.options
|
||||||
|
}
|
||||||
|
|
||||||
|
function finish (self) {
|
||||||
|
var nou = self.nounique
|
||||||
|
var all = nou ? [] : Object.create(null)
|
||||||
|
|
||||||
|
for (var i = 0, l = self.matches.length; i < l; i ++) {
|
||||||
|
var matches = self.matches[i]
|
||||||
|
if (!matches || Object.keys(matches).length === 0) {
|
||||||
|
if (self.nonull) {
|
||||||
|
// do like the shell, and spit out the literal glob
|
||||||
|
var literal = self.minimatch.globSet[i]
|
||||||
|
if (nou)
|
||||||
|
all.push(literal)
|
||||||
|
else
|
||||||
|
all[literal] = true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// had matches
|
||||||
|
var m = Object.keys(matches)
|
||||||
|
if (nou)
|
||||||
|
all.push.apply(all, m)
|
||||||
|
else
|
||||||
|
m.forEach(function (m) {
|
||||||
|
all[m] = true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!nou)
|
||||||
|
all = Object.keys(all)
|
||||||
|
|
||||||
|
if (!self.nosort)
|
||||||
|
all = all.sort(alphasort)
|
||||||
|
|
||||||
|
// at *some* point we statted all of these
|
||||||
|
if (self.mark) {
|
||||||
|
for (var i = 0; i < all.length; i++) {
|
||||||
|
all[i] = self._mark(all[i])
|
||||||
|
}
|
||||||
|
if (self.nodir) {
|
||||||
|
all = all.filter(function (e) {
|
||||||
|
var notDir = !(/\/$/.test(e))
|
||||||
|
var c = self.cache[e] || self.cache[makeAbs(self, e)]
|
||||||
|
if (notDir && c)
|
||||||
|
notDir = c !== 'DIR' && !Array.isArray(c)
|
||||||
|
return notDir
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (self.ignore.length)
|
||||||
|
all = all.filter(function(m) {
|
||||||
|
return !isIgnored(self, m)
|
||||||
|
})
|
||||||
|
|
||||||
|
self.found = all
|
||||||
|
}
|
||||||
|
|
||||||
|
function mark (self, p) {
|
||||||
|
var abs = makeAbs(self, p)
|
||||||
|
var c = self.cache[abs]
|
||||||
|
var m = p
|
||||||
|
if (c) {
|
||||||
|
var isDir = c === 'DIR' || Array.isArray(c)
|
||||||
|
var slash = p.slice(-1) === '/'
|
||||||
|
|
||||||
|
if (isDir && !slash)
|
||||||
|
m += '/'
|
||||||
|
else if (!isDir && slash)
|
||||||
|
m = m.slice(0, -1)
|
||||||
|
|
||||||
|
if (m !== p) {
|
||||||
|
var mabs = makeAbs(self, m)
|
||||||
|
self.statCache[mabs] = self.statCache[abs]
|
||||||
|
self.cache[mabs] = self.cache[abs]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
|
||||||
|
// lotta situps...
|
||||||
|
function makeAbs (self, f) {
|
||||||
|
var abs = f
|
||||||
|
if (f.charAt(0) === '/') {
|
||||||
|
abs = path.join(self.root, f)
|
||||||
|
} else if (isAbsolute(f) || f === '') {
|
||||||
|
abs = f
|
||||||
|
} else if (self.changedCwd) {
|
||||||
|
abs = path.resolve(self.cwd, f)
|
||||||
|
} else {
|
||||||
|
abs = path.resolve(f)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.platform === 'win32')
|
||||||
|
abs = abs.replace(/\\/g, '/')
|
||||||
|
|
||||||
|
return abs
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Return true, if pattern ends with globstar '**', for the accompanying parent directory.
|
||||||
|
// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
|
||||||
|
function isIgnored (self, path) {
|
||||||
|
if (!self.ignore.length)
|
||||||
|
return false
|
||||||
|
|
||||||
|
return self.ignore.some(function(item) {
|
||||||
|
return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function childrenIgnored (self, path) {
|
||||||
|
if (!self.ignore.length)
|
||||||
|
return false
|
||||||
|
|
||||||
|
return self.ignore.some(function(item) {
|
||||||
|
return !!(item.gmatcher && item.gmatcher.match(path))
|
||||||
|
})
|
||||||
|
}
|
790
mybulma/node_modules/glob/glob.js
generated
vendored
Normal file
790
mybulma/node_modules/glob/glob.js
generated
vendored
Normal file
|
@ -0,0 +1,790 @@
|
||||||
|
// Approach:
|
||||||
|
//
|
||||||
|
// 1. Get the minimatch set
|
||||||
|
// 2. For each pattern in the set, PROCESS(pattern, false)
|
||||||
|
// 3. Store matches per-set, then uniq them
|
||||||
|
//
|
||||||
|
// PROCESS(pattern, inGlobStar)
|
||||||
|
// Get the first [n] items from pattern that are all strings
|
||||||
|
// Join these together. This is PREFIX.
|
||||||
|
// If there is no more remaining, then stat(PREFIX) and
|
||||||
|
// add to matches if it succeeds. END.
|
||||||
|
//
|
||||||
|
// If inGlobStar and PREFIX is symlink and points to dir
|
||||||
|
// set ENTRIES = []
|
||||||
|
// else readdir(PREFIX) as ENTRIES
|
||||||
|
// If fail, END
|
||||||
|
//
|
||||||
|
// with ENTRIES
|
||||||
|
// If pattern[n] is GLOBSTAR
|
||||||
|
// // handle the case where the globstar match is empty
|
||||||
|
// // by pruning it out, and testing the resulting pattern
|
||||||
|
// PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
|
||||||
|
// // handle other cases.
|
||||||
|
// for ENTRY in ENTRIES (not dotfiles)
|
||||||
|
// // attach globstar + tail onto the entry
|
||||||
|
// // Mark that this entry is a globstar match
|
||||||
|
// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
|
||||||
|
//
|
||||||
|
// else // not globstar
|
||||||
|
// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
|
||||||
|
// Test ENTRY against pattern[n]
|
||||||
|
// If fails, continue
|
||||||
|
// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
|
||||||
|
//
|
||||||
|
// Caveat:
|
||||||
|
// Cache all stats and readdirs results to minimize syscall. Since all
|
||||||
|
// we ever care about is existence and directory-ness, we can just keep
|
||||||
|
// `true` for files, and [children,...] for directories, or `false` for
|
||||||
|
// things that don't exist.
|
||||||
|
|
||||||
|
module.exports = glob
|
||||||
|
|
||||||
|
var rp = require('fs.realpath')
|
||||||
|
var minimatch = require('minimatch')
|
||||||
|
var Minimatch = minimatch.Minimatch
|
||||||
|
var inherits = require('inherits')
|
||||||
|
var EE = require('events').EventEmitter
|
||||||
|
var path = require('path')
|
||||||
|
var assert = require('assert')
|
||||||
|
var isAbsolute = require('path-is-absolute')
|
||||||
|
var globSync = require('./sync.js')
|
||||||
|
var common = require('./common.js')
|
||||||
|
var setopts = common.setopts
|
||||||
|
var ownProp = common.ownProp
|
||||||
|
var inflight = require('inflight')
|
||||||
|
var util = require('util')
|
||||||
|
var childrenIgnored = common.childrenIgnored
|
||||||
|
var isIgnored = common.isIgnored
|
||||||
|
|
||||||
|
var once = require('once')
|
||||||
|
|
||||||
|
function glob (pattern, options, cb) {
|
||||||
|
if (typeof options === 'function') cb = options, options = {}
|
||||||
|
if (!options) options = {}
|
||||||
|
|
||||||
|
if (options.sync) {
|
||||||
|
if (cb)
|
||||||
|
throw new TypeError('callback provided to sync glob')
|
||||||
|
return globSync(pattern, options)
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Glob(pattern, options, cb)
|
||||||
|
}
|
||||||
|
|
||||||
|
glob.sync = globSync
|
||||||
|
var GlobSync = glob.GlobSync = globSync.GlobSync
|
||||||
|
|
||||||
|
// old api surface
|
||||||
|
glob.glob = glob
|
||||||
|
|
||||||
|
function extend (origin, add) {
|
||||||
|
if (add === null || typeof add !== 'object') {
|
||||||
|
return origin
|
||||||
|
}
|
||||||
|
|
||||||
|
var keys = Object.keys(add)
|
||||||
|
var i = keys.length
|
||||||
|
while (i--) {
|
||||||
|
origin[keys[i]] = add[keys[i]]
|
||||||
|
}
|
||||||
|
return origin
|
||||||
|
}
|
||||||
|
|
||||||
|
glob.hasMagic = function (pattern, options_) {
|
||||||
|
var options = extend({}, options_)
|
||||||
|
options.noprocess = true
|
||||||
|
|
||||||
|
var g = new Glob(pattern, options)
|
||||||
|
var set = g.minimatch.set
|
||||||
|
|
||||||
|
if (!pattern)
|
||||||
|
return false
|
||||||
|
|
||||||
|
if (set.length > 1)
|
||||||
|
return true
|
||||||
|
|
||||||
|
for (var j = 0; j < set[0].length; j++) {
|
||||||
|
if (typeof set[0][j] !== 'string')
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
glob.Glob = Glob
|
||||||
|
inherits(Glob, EE)
|
||||||
|
function Glob (pattern, options, cb) {
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
cb = options
|
||||||
|
options = null
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options && options.sync) {
|
||||||
|
if (cb)
|
||||||
|
throw new TypeError('callback provided to sync glob')
|
||||||
|
return new GlobSync(pattern, options)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(this instanceof Glob))
|
||||||
|
return new Glob(pattern, options, cb)
|
||||||
|
|
||||||
|
setopts(this, pattern, options)
|
||||||
|
this._didRealPath = false
|
||||||
|
|
||||||
|
// process each pattern in the minimatch set
|
||||||
|
var n = this.minimatch.set.length
|
||||||
|
|
||||||
|
// The matches are stored as {<filename>: true,...} so that
|
||||||
|
// duplicates are automagically pruned.
|
||||||
|
// Later, we do an Object.keys() on these.
|
||||||
|
// Keep them as a list so we can fill in when nonull is set.
|
||||||
|
this.matches = new Array(n)
|
||||||
|
|
||||||
|
if (typeof cb === 'function') {
|
||||||
|
cb = once(cb)
|
||||||
|
this.on('error', cb)
|
||||||
|
this.on('end', function (matches) {
|
||||||
|
cb(null, matches)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var self = this
|
||||||
|
this._processing = 0
|
||||||
|
|
||||||
|
this._emitQueue = []
|
||||||
|
this._processQueue = []
|
||||||
|
this.paused = false
|
||||||
|
|
||||||
|
if (this.noprocess)
|
||||||
|
return this
|
||||||
|
|
||||||
|
if (n === 0)
|
||||||
|
return done()
|
||||||
|
|
||||||
|
var sync = true
|
||||||
|
for (var i = 0; i < n; i ++) {
|
||||||
|
this._process(this.minimatch.set[i], i, false, done)
|
||||||
|
}
|
||||||
|
sync = false
|
||||||
|
|
||||||
|
function done () {
|
||||||
|
--self._processing
|
||||||
|
if (self._processing <= 0) {
|
||||||
|
if (sync) {
|
||||||
|
process.nextTick(function () {
|
||||||
|
self._finish()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
self._finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype._finish = function () {
|
||||||
|
assert(this instanceof Glob)
|
||||||
|
if (this.aborted)
|
||||||
|
return
|
||||||
|
|
||||||
|
if (this.realpath && !this._didRealpath)
|
||||||
|
return this._realpath()
|
||||||
|
|
||||||
|
common.finish(this)
|
||||||
|
this.emit('end', this.found)
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype._realpath = function () {
|
||||||
|
if (this._didRealpath)
|
||||||
|
return
|
||||||
|
|
||||||
|
this._didRealpath = true
|
||||||
|
|
||||||
|
var n = this.matches.length
|
||||||
|
if (n === 0)
|
||||||
|
return this._finish()
|
||||||
|
|
||||||
|
var self = this
|
||||||
|
for (var i = 0; i < this.matches.length; i++)
|
||||||
|
this._realpathSet(i, next)
|
||||||
|
|
||||||
|
function next () {
|
||||||
|
if (--n === 0)
|
||||||
|
self._finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype._realpathSet = function (index, cb) {
|
||||||
|
var matchset = this.matches[index]
|
||||||
|
if (!matchset)
|
||||||
|
return cb()
|
||||||
|
|
||||||
|
var found = Object.keys(matchset)
|
||||||
|
var self = this
|
||||||
|
var n = found.length
|
||||||
|
|
||||||
|
if (n === 0)
|
||||||
|
return cb()
|
||||||
|
|
||||||
|
var set = this.matches[index] = Object.create(null)
|
||||||
|
found.forEach(function (p, i) {
|
||||||
|
// If there's a problem with the stat, then it means that
|
||||||
|
// one or more of the links in the realpath couldn't be
|
||||||
|
// resolved. just return the abs value in that case.
|
||||||
|
p = self._makeAbs(p)
|
||||||
|
rp.realpath(p, self.realpathCache, function (er, real) {
|
||||||
|
if (!er)
|
||||||
|
set[real] = true
|
||||||
|
else if (er.syscall === 'stat')
|
||||||
|
set[p] = true
|
||||||
|
else
|
||||||
|
self.emit('error', er) // srsly wtf right here
|
||||||
|
|
||||||
|
if (--n === 0) {
|
||||||
|
self.matches[index] = set
|
||||||
|
cb()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype._mark = function (p) {
|
||||||
|
return common.mark(this, p)
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype._makeAbs = function (f) {
|
||||||
|
return common.makeAbs(this, f)
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype.abort = function () {
|
||||||
|
this.aborted = true
|
||||||
|
this.emit('abort')
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype.pause = function () {
|
||||||
|
if (!this.paused) {
|
||||||
|
this.paused = true
|
||||||
|
this.emit('pause')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype.resume = function () {
|
||||||
|
if (this.paused) {
|
||||||
|
this.emit('resume')
|
||||||
|
this.paused = false
|
||||||
|
if (this._emitQueue.length) {
|
||||||
|
var eq = this._emitQueue.slice(0)
|
||||||
|
this._emitQueue.length = 0
|
||||||
|
for (var i = 0; i < eq.length; i ++) {
|
||||||
|
var e = eq[i]
|
||||||
|
this._emitMatch(e[0], e[1])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this._processQueue.length) {
|
||||||
|
var pq = this._processQueue.slice(0)
|
||||||
|
this._processQueue.length = 0
|
||||||
|
for (var i = 0; i < pq.length; i ++) {
|
||||||
|
var p = pq[i]
|
||||||
|
this._processing--
|
||||||
|
this._process(p[0], p[1], p[2], p[3])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
|
||||||
|
assert(this instanceof Glob)
|
||||||
|
assert(typeof cb === 'function')
|
||||||
|
|
||||||
|
if (this.aborted)
|
||||||
|
return
|
||||||
|
|
||||||
|
this._processing++
|
||||||
|
if (this.paused) {
|
||||||
|
this._processQueue.push([pattern, index, inGlobStar, cb])
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//console.error('PROCESS %d', this._processing, pattern)
|
||||||
|
|
||||||
|
// Get the first [n] parts of pattern that are all strings.
|
||||||
|
var n = 0
|
||||||
|
while (typeof pattern[n] === 'string') {
|
||||||
|
n ++
|
||||||
|
}
|
||||||
|
// now n is the index of the first one that is *not* a string.
|
||||||
|
|
||||||
|
// see if there's anything else
|
||||||
|
var prefix
|
||||||
|
switch (n) {
|
||||||
|
// if not, then this is rather simple
|
||||||
|
case pattern.length:
|
||||||
|
this._processSimple(pattern.join('/'), index, cb)
|
||||||
|
return
|
||||||
|
|
||||||
|
case 0:
|
||||||
|
// pattern *starts* with some non-trivial item.
|
||||||
|
// going to readdir(cwd), but not include the prefix in matches.
|
||||||
|
prefix = null
|
||||||
|
break
|
||||||
|
|
||||||
|
default:
|
||||||
|
// pattern has some string bits in the front.
|
||||||
|
// whatever it starts with, whether that's 'absolute' like /foo/bar,
|
||||||
|
// or 'relative' like '../baz'
|
||||||
|
prefix = pattern.slice(0, n).join('/')
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
var remain = pattern.slice(n)
|
||||||
|
|
||||||
|
// get the list of entries.
|
||||||
|
var read
|
||||||
|
if (prefix === null)
|
||||||
|
read = '.'
|
||||||
|
else if (isAbsolute(prefix) ||
|
||||||
|
isAbsolute(pattern.map(function (p) {
|
||||||
|
return typeof p === 'string' ? p : '[*]'
|
||||||
|
}).join('/'))) {
|
||||||
|
if (!prefix || !isAbsolute(prefix))
|
||||||
|
prefix = '/' + prefix
|
||||||
|
read = prefix
|
||||||
|
} else
|
||||||
|
read = prefix
|
||||||
|
|
||||||
|
var abs = this._makeAbs(read)
|
||||||
|
|
||||||
|
//if ignored, skip _processing
|
||||||
|
if (childrenIgnored(this, read))
|
||||||
|
return cb()
|
||||||
|
|
||||||
|
var isGlobStar = remain[0] === minimatch.GLOBSTAR
|
||||||
|
if (isGlobStar)
|
||||||
|
this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
|
||||||
|
else
|
||||||
|
this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
|
||||||
|
var self = this
|
||||||
|
this._readdir(abs, inGlobStar, function (er, entries) {
|
||||||
|
return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
|
||||||
|
|
||||||
|
// if the abs isn't a dir, then nothing can match!
|
||||||
|
if (!entries)
|
||||||
|
return cb()
|
||||||
|
|
||||||
|
// It will only match dot entries if it starts with a dot, or if
|
||||||
|
// dot is set. Stuff like @(.foo|.bar) isn't allowed.
|
||||||
|
var pn = remain[0]
|
||||||
|
var negate = !!this.minimatch.negate
|
||||||
|
var rawGlob = pn._glob
|
||||||
|
var dotOk = this.dot || rawGlob.charAt(0) === '.'
|
||||||
|
|
||||||
|
var matchedEntries = []
|
||||||
|
for (var i = 0; i < entries.length; i++) {
|
||||||
|
var e = entries[i]
|
||||||
|
if (e.charAt(0) !== '.' || dotOk) {
|
||||||
|
var m
|
||||||
|
if (negate && !prefix) {
|
||||||
|
m = !e.match(pn)
|
||||||
|
} else {
|
||||||
|
m = e.match(pn)
|
||||||
|
}
|
||||||
|
if (m)
|
||||||
|
matchedEntries.push(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
|
||||||
|
|
||||||
|
var len = matchedEntries.length
|
||||||
|
// If there are no matched entries, then nothing matches.
|
||||||
|
if (len === 0)
|
||||||
|
return cb()
|
||||||
|
|
||||||
|
// if this is the last remaining pattern bit, then no need for
|
||||||
|
// an additional stat *unless* the user has specified mark or
|
||||||
|
// stat explicitly. We know they exist, since readdir returned
|
||||||
|
// them.
|
||||||
|
|
||||||
|
if (remain.length === 1 && !this.mark && !this.stat) {
|
||||||
|
if (!this.matches[index])
|
||||||
|
this.matches[index] = Object.create(null)
|
||||||
|
|
||||||
|
for (var i = 0; i < len; i ++) {
|
||||||
|
var e = matchedEntries[i]
|
||||||
|
if (prefix) {
|
||||||
|
if (prefix !== '/')
|
||||||
|
e = prefix + '/' + e
|
||||||
|
else
|
||||||
|
e = prefix + e
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.charAt(0) === '/' && !this.nomount) {
|
||||||
|
e = path.join(this.root, e)
|
||||||
|
}
|
||||||
|
this._emitMatch(index, e)
|
||||||
|
}
|
||||||
|
// This was the last one, and no stats were needed
|
||||||
|
return cb()
|
||||||
|
}
|
||||||
|
|
||||||
|
// now test all matched entries as stand-ins for that part
|
||||||
|
// of the pattern.
|
||||||
|
remain.shift()
|
||||||
|
for (var i = 0; i < len; i ++) {
|
||||||
|
var e = matchedEntries[i]
|
||||||
|
var newPattern
|
||||||
|
if (prefix) {
|
||||||
|
if (prefix !== '/')
|
||||||
|
e = prefix + '/' + e
|
||||||
|
else
|
||||||
|
e = prefix + e
|
||||||
|
}
|
||||||
|
this._process([e].concat(remain), index, inGlobStar, cb)
|
||||||
|
}
|
||||||
|
cb()
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype._emitMatch = function (index, e) {
|
||||||
|
if (this.aborted)
|
||||||
|
return
|
||||||
|
|
||||||
|
if (isIgnored(this, e))
|
||||||
|
return
|
||||||
|
|
||||||
|
if (this.paused) {
|
||||||
|
this._emitQueue.push([index, e])
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var abs = isAbsolute(e) ? e : this._makeAbs(e)
|
||||||
|
|
||||||
|
if (this.mark)
|
||||||
|
e = this._mark(e)
|
||||||
|
|
||||||
|
if (this.absolute)
|
||||||
|
e = abs
|
||||||
|
|
||||||
|
if (this.matches[index][e])
|
||||||
|
return
|
||||||
|
|
||||||
|
if (this.nodir) {
|
||||||
|
var c = this.cache[abs]
|
||||||
|
if (c === 'DIR' || Array.isArray(c))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.matches[index][e] = true
|
||||||
|
|
||||||
|
var st = this.statCache[abs]
|
||||||
|
if (st)
|
||||||
|
this.emit('stat', e, st)
|
||||||
|
|
||||||
|
this.emit('match', e)
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype._readdirInGlobStar = function (abs, cb) {
|
||||||
|
if (this.aborted)
|
||||||
|
return
|
||||||
|
|
||||||
|
// follow all symlinked directories forever
|
||||||
|
// just proceed as if this is a non-globstar situation
|
||||||
|
if (this.follow)
|
||||||
|
return this._readdir(abs, false, cb)
|
||||||
|
|
||||||
|
var lstatkey = 'lstat\0' + abs
|
||||||
|
var self = this
|
||||||
|
var lstatcb = inflight(lstatkey, lstatcb_)
|
||||||
|
|
||||||
|
if (lstatcb)
|
||||||
|
self.fs.lstat(abs, lstatcb)
|
||||||
|
|
||||||
|
function lstatcb_ (er, lstat) {
|
||||||
|
if (er && er.code === 'ENOENT')
|
||||||
|
return cb()
|
||||||
|
|
||||||
|
var isSym = lstat && lstat.isSymbolicLink()
|
||||||
|
self.symlinks[abs] = isSym
|
||||||
|
|
||||||
|
// If it's not a symlink or a dir, then it's definitely a regular file.
|
||||||
|
// don't bother doing a readdir in that case.
|
||||||
|
if (!isSym && lstat && !lstat.isDirectory()) {
|
||||||
|
self.cache[abs] = 'FILE'
|
||||||
|
cb()
|
||||||
|
} else
|
||||||
|
self._readdir(abs, false, cb)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype._readdir = function (abs, inGlobStar, cb) {
|
||||||
|
if (this.aborted)
|
||||||
|
return
|
||||||
|
|
||||||
|
cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
|
||||||
|
if (!cb)
|
||||||
|
return
|
||||||
|
|
||||||
|
//console.error('RD %j %j', +inGlobStar, abs)
|
||||||
|
if (inGlobStar && !ownProp(this.symlinks, abs))
|
||||||
|
return this._readdirInGlobStar(abs, cb)
|
||||||
|
|
||||||
|
if (ownProp(this.cache, abs)) {
|
||||||
|
var c = this.cache[abs]
|
||||||
|
if (!c || c === 'FILE')
|
||||||
|
return cb()
|
||||||
|
|
||||||
|
if (Array.isArray(c))
|
||||||
|
return cb(null, c)
|
||||||
|
}
|
||||||
|
|
||||||
|
var self = this
|
||||||
|
self.fs.readdir(abs, readdirCb(this, abs, cb))
|
||||||
|
}
|
||||||
|
|
||||||
|
function readdirCb (self, abs, cb) {
|
||||||
|
return function (er, entries) {
|
||||||
|
if (er)
|
||||||
|
self._readdirError(abs, er, cb)
|
||||||
|
else
|
||||||
|
self._readdirEntries(abs, entries, cb)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype._readdirEntries = function (abs, entries, cb) {
|
||||||
|
if (this.aborted)
|
||||||
|
return
|
||||||
|
|
||||||
|
// if we haven't asked to stat everything, then just
|
||||||
|
// assume that everything in there exists, so we can avoid
|
||||||
|
// having to stat it a second time.
|
||||||
|
if (!this.mark && !this.stat) {
|
||||||
|
for (var i = 0; i < entries.length; i ++) {
|
||||||
|
var e = entries[i]
|
||||||
|
if (abs === '/')
|
||||||
|
e = abs + e
|
||||||
|
else
|
||||||
|
e = abs + '/' + e
|
||||||
|
this.cache[e] = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.cache[abs] = entries
|
||||||
|
return cb(null, entries)
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype._readdirError = function (f, er, cb) {
|
||||||
|
if (this.aborted)
|
||||||
|
return
|
||||||
|
|
||||||
|
// handle errors, and cache the information
|
||||||
|
switch (er.code) {
|
||||||
|
case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
|
||||||
|
case 'ENOTDIR': // totally normal. means it *does* exist.
|
||||||
|
var abs = this._makeAbs(f)
|
||||||
|
this.cache[abs] = 'FILE'
|
||||||
|
if (abs === this.cwdAbs) {
|
||||||
|
var error = new Error(er.code + ' invalid cwd ' + this.cwd)
|
||||||
|
error.path = this.cwd
|
||||||
|
error.code = er.code
|
||||||
|
this.emit('error', error)
|
||||||
|
this.abort()
|
||||||
|
}
|
||||||
|
break
|
||||||
|
|
||||||
|
case 'ENOENT': // not terribly unusual
|
||||||
|
case 'ELOOP':
|
||||||
|
case 'ENAMETOOLONG':
|
||||||
|
case 'UNKNOWN':
|
||||||
|
this.cache[this._makeAbs(f)] = false
|
||||||
|
break
|
||||||
|
|
||||||
|
default: // some unusual error. Treat as failure.
|
||||||
|
this.cache[this._makeAbs(f)] = false
|
||||||
|
if (this.strict) {
|
||||||
|
this.emit('error', er)
|
||||||
|
// If the error is handled, then we abort
|
||||||
|
// if not, we threw out of here
|
||||||
|
this.abort()
|
||||||
|
}
|
||||||
|
if (!this.silent)
|
||||||
|
console.error('glob error', er)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
return cb()
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
|
||||||
|
var self = this
|
||||||
|
this._readdir(abs, inGlobStar, function (er, entries) {
|
||||||
|
self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
|
||||||
|
//console.error('pgs2', prefix, remain[0], entries)
|
||||||
|
|
||||||
|
// no entries means not a dir, so it can never have matches
|
||||||
|
// foo.txt/** doesn't match foo.txt
|
||||||
|
if (!entries)
|
||||||
|
return cb()
|
||||||
|
|
||||||
|
// test without the globstar, and with every child both below
|
||||||
|
// and replacing the globstar.
|
||||||
|
var remainWithoutGlobStar = remain.slice(1)
|
||||||
|
var gspref = prefix ? [ prefix ] : []
|
||||||
|
var noGlobStar = gspref.concat(remainWithoutGlobStar)
|
||||||
|
|
||||||
|
// the noGlobStar pattern exits the inGlobStar state
|
||||||
|
this._process(noGlobStar, index, false, cb)
|
||||||
|
|
||||||
|
var isSym = this.symlinks[abs]
|
||||||
|
var len = entries.length
|
||||||
|
|
||||||
|
// If it's a symlink, and we're in a globstar, then stop
|
||||||
|
if (isSym && inGlobStar)
|
||||||
|
return cb()
|
||||||
|
|
||||||
|
for (var i = 0; i < len; i++) {
|
||||||
|
var e = entries[i]
|
||||||
|
if (e.charAt(0) === '.' && !this.dot)
|
||||||
|
continue
|
||||||
|
|
||||||
|
// these two cases enter the inGlobStar state
|
||||||
|
var instead = gspref.concat(entries[i], remainWithoutGlobStar)
|
||||||
|
this._process(instead, index, true, cb)
|
||||||
|
|
||||||
|
var below = gspref.concat(entries[i], remain)
|
||||||
|
this._process(below, index, true, cb)
|
||||||
|
}
|
||||||
|
|
||||||
|
cb()
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype._processSimple = function (prefix, index, cb) {
|
||||||
|
// XXX review this. Shouldn't it be doing the mounting etc
|
||||||
|
// before doing stat? kinda weird?
|
||||||
|
var self = this
|
||||||
|
this._stat(prefix, function (er, exists) {
|
||||||
|
self._processSimple2(prefix, index, er, exists, cb)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
|
||||||
|
|
||||||
|
//console.error('ps2', prefix, exists)
|
||||||
|
|
||||||
|
if (!this.matches[index])
|
||||||
|
this.matches[index] = Object.create(null)
|
||||||
|
|
||||||
|
// If it doesn't exist, then just mark the lack of results
|
||||||
|
if (!exists)
|
||||||
|
return cb()
|
||||||
|
|
||||||
|
if (prefix && isAbsolute(prefix) && !this.nomount) {
|
||||||
|
var trail = /[\/\\]$/.test(prefix)
|
||||||
|
if (prefix.charAt(0) === '/') {
|
||||||
|
prefix = path.join(this.root, prefix)
|
||||||
|
} else {
|
||||||
|
prefix = path.resolve(this.root, prefix)
|
||||||
|
if (trail)
|
||||||
|
prefix += '/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.platform === 'win32')
|
||||||
|
prefix = prefix.replace(/\\/g, '/')
|
||||||
|
|
||||||
|
// Mark this as a match
|
||||||
|
this._emitMatch(index, prefix)
|
||||||
|
cb()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns either 'DIR', 'FILE', or false
|
||||||
|
Glob.prototype._stat = function (f, cb) {
|
||||||
|
var abs = this._makeAbs(f)
|
||||||
|
var needDir = f.slice(-1) === '/'
|
||||||
|
|
||||||
|
if (f.length > this.maxLength)
|
||||||
|
return cb()
|
||||||
|
|
||||||
|
if (!this.stat && ownProp(this.cache, abs)) {
|
||||||
|
var c = this.cache[abs]
|
||||||
|
|
||||||
|
if (Array.isArray(c))
|
||||||
|
c = 'DIR'
|
||||||
|
|
||||||
|
// It exists, but maybe not how we need it
|
||||||
|
if (!needDir || c === 'DIR')
|
||||||
|
return cb(null, c)
|
||||||
|
|
||||||
|
if (needDir && c === 'FILE')
|
||||||
|
return cb()
|
||||||
|
|
||||||
|
// otherwise we have to stat, because maybe c=true
|
||||||
|
// if we know it exists, but not what it is.
|
||||||
|
}
|
||||||
|
|
||||||
|
var exists
|
||||||
|
var stat = this.statCache[abs]
|
||||||
|
if (stat !== undefined) {
|
||||||
|
if (stat === false)
|
||||||
|
return cb(null, stat)
|
||||||
|
else {
|
||||||
|
var type = stat.isDirectory() ? 'DIR' : 'FILE'
|
||||||
|
if (needDir && type === 'FILE')
|
||||||
|
return cb()
|
||||||
|
else
|
||||||
|
return cb(null, type, stat)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var self = this
|
||||||
|
var statcb = inflight('stat\0' + abs, lstatcb_)
|
||||||
|
if (statcb)
|
||||||
|
self.fs.lstat(abs, statcb)
|
||||||
|
|
||||||
|
function lstatcb_ (er, lstat) {
|
||||||
|
if (lstat && lstat.isSymbolicLink()) {
|
||||||
|
// If it's a symlink, then treat it as the target, unless
|
||||||
|
// the target does not exist, then treat it as a file.
|
||||||
|
return self.fs.stat(abs, function (er, stat) {
|
||||||
|
if (er)
|
||||||
|
self._stat2(f, abs, null, lstat, cb)
|
||||||
|
else
|
||||||
|
self._stat2(f, abs, er, stat, cb)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
self._stat2(f, abs, er, lstat, cb)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
|
||||||
|
if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
|
||||||
|
this.statCache[abs] = false
|
||||||
|
return cb()
|
||||||
|
}
|
||||||
|
|
||||||
|
var needDir = f.slice(-1) === '/'
|
||||||
|
this.statCache[abs] = stat
|
||||||
|
|
||||||
|
if (abs.slice(-1) === '/' && stat && !stat.isDirectory())
|
||||||
|
return cb(null, false, stat)
|
||||||
|
|
||||||
|
var c = true
|
||||||
|
if (stat)
|
||||||
|
c = stat.isDirectory() ? 'DIR' : 'FILE'
|
||||||
|
this.cache[abs] = this.cache[abs] || c
|
||||||
|
|
||||||
|
if (needDir && c === 'FILE')
|
||||||
|
return cb()
|
||||||
|
|
||||||
|
return cb(null, c, stat)
|
||||||
|
}
|
55
mybulma/node_modules/glob/package.json
generated
vendored
Normal file
55
mybulma/node_modules/glob/package.json
generated
vendored
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
{
|
||||||
|
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
||||||
|
"name": "glob",
|
||||||
|
"description": "a little globber",
|
||||||
|
"version": "7.2.3",
|
||||||
|
"publishConfig": {
|
||||||
|
"tag": "v7-legacy"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/isaacs/node-glob.git"
|
||||||
|
},
|
||||||
|
"main": "glob.js",
|
||||||
|
"files": [
|
||||||
|
"glob.js",
|
||||||
|
"sync.js",
|
||||||
|
"common.js"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": "*"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"fs.realpath": "^1.0.0",
|
||||||
|
"inflight": "^1.0.4",
|
||||||
|
"inherits": "2",
|
||||||
|
"minimatch": "^3.1.1",
|
||||||
|
"once": "^1.3.0",
|
||||||
|
"path-is-absolute": "^1.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"memfs": "^3.2.0",
|
||||||
|
"mkdirp": "0",
|
||||||
|
"rimraf": "^2.2.8",
|
||||||
|
"tap": "^15.0.6",
|
||||||
|
"tick": "0.0.6"
|
||||||
|
},
|
||||||
|
"tap": {
|
||||||
|
"before": "test/00-setup.js",
|
||||||
|
"after": "test/zz-cleanup.js",
|
||||||
|
"jobs": 1
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"prepublish": "npm run benchclean",
|
||||||
|
"profclean": "rm -f v8.log profile.txt",
|
||||||
|
"test": "tap",
|
||||||
|
"test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js",
|
||||||
|
"bench": "bash benchmark.sh",
|
||||||
|
"prof": "bash prof.sh && cat profile.txt",
|
||||||
|
"benchclean": "node benchclean.js"
|
||||||
|
},
|
||||||
|
"license": "ISC",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
}
|
||||||
|
}
|
486
mybulma/node_modules/glob/sync.js
generated
vendored
Normal file
486
mybulma/node_modules/glob/sync.js
generated
vendored
Normal file
|
@ -0,0 +1,486 @@
|
||||||
|
module.exports = globSync
|
||||||
|
globSync.GlobSync = GlobSync
|
||||||
|
|
||||||
|
var rp = require('fs.realpath')
|
||||||
|
var minimatch = require('minimatch')
|
||||||
|
var Minimatch = minimatch.Minimatch
|
||||||
|
var Glob = require('./glob.js').Glob
|
||||||
|
var util = require('util')
|
||||||
|
var path = require('path')
|
||||||
|
var assert = require('assert')
|
||||||
|
var isAbsolute = require('path-is-absolute')
|
||||||
|
var common = require('./common.js')
|
||||||
|
var setopts = common.setopts
|
||||||
|
var ownProp = common.ownProp
|
||||||
|
var childrenIgnored = common.childrenIgnored
|
||||||
|
var isIgnored = common.isIgnored
|
||||||
|
|
||||||
|
function globSync (pattern, options) {
|
||||||
|
if (typeof options === 'function' || arguments.length === 3)
|
||||||
|
throw new TypeError('callback provided to sync glob\n'+
|
||||||
|
'See: https://github.com/isaacs/node-glob/issues/167')
|
||||||
|
|
||||||
|
return new GlobSync(pattern, options).found
|
||||||
|
}
|
||||||
|
|
||||||
|
function GlobSync (pattern, options) {
|
||||||
|
if (!pattern)
|
||||||
|
throw new Error('must provide pattern')
|
||||||
|
|
||||||
|
if (typeof options === 'function' || arguments.length === 3)
|
||||||
|
throw new TypeError('callback provided to sync glob\n'+
|
||||||
|
'See: https://github.com/isaacs/node-glob/issues/167')
|
||||||
|
|
||||||
|
if (!(this instanceof GlobSync))
|
||||||
|
return new GlobSync(pattern, options)
|
||||||
|
|
||||||
|
setopts(this, pattern, options)
|
||||||
|
|
||||||
|
if (this.noprocess)
|
||||||
|
return this
|
||||||
|
|
||||||
|
var n = this.minimatch.set.length
|
||||||
|
this.matches = new Array(n)
|
||||||
|
for (var i = 0; i < n; i ++) {
|
||||||
|
this._process(this.minimatch.set[i], i, false)
|
||||||
|
}
|
||||||
|
this._finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
GlobSync.prototype._finish = function () {
|
||||||
|
assert.ok(this instanceof GlobSync)
|
||||||
|
if (this.realpath) {
|
||||||
|
var self = this
|
||||||
|
this.matches.forEach(function (matchset, index) {
|
||||||
|
var set = self.matches[index] = Object.create(null)
|
||||||
|
for (var p in matchset) {
|
||||||
|
try {
|
||||||
|
p = self._makeAbs(p)
|
||||||
|
var real = rp.realpathSync(p, self.realpathCache)
|
||||||
|
set[real] = true
|
||||||
|
} catch (er) {
|
||||||
|
if (er.syscall === 'stat')
|
||||||
|
set[self._makeAbs(p)] = true
|
||||||
|
else
|
||||||
|
throw er
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
common.finish(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
GlobSync.prototype._process = function (pattern, index, inGlobStar) {
|
||||||
|
assert.ok(this instanceof GlobSync)
|
||||||
|
|
||||||
|
// Get the first [n] parts of pattern that are all strings.
|
||||||
|
var n = 0
|
||||||
|
while (typeof pattern[n] === 'string') {
|
||||||
|
n ++
|
||||||
|
}
|
||||||
|
// now n is the index of the first one that is *not* a string.
|
||||||
|
|
||||||
|
// See if there's anything else
|
||||||
|
var prefix
|
||||||
|
switch (n) {
|
||||||
|
// if not, then this is rather simple
|
||||||
|
case pattern.length:
|
||||||
|
this._processSimple(pattern.join('/'), index)
|
||||||
|
return
|
||||||
|
|
||||||
|
case 0:
|
||||||
|
// pattern *starts* with some non-trivial item.
|
||||||
|
// going to readdir(cwd), but not include the prefix in matches.
|
||||||
|
prefix = null
|
||||||
|
break
|
||||||
|
|
||||||
|
default:
|
||||||
|
// pattern has some string bits in the front.
|
||||||
|
// whatever it starts with, whether that's 'absolute' like /foo/bar,
|
||||||
|
// or 'relative' like '../baz'
|
||||||
|
prefix = pattern.slice(0, n).join('/')
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
var remain = pattern.slice(n)
|
||||||
|
|
||||||
|
// get the list of entries.
|
||||||
|
var read
|
||||||
|
if (prefix === null)
|
||||||
|
read = '.'
|
||||||
|
else if (isAbsolute(prefix) ||
|
||||||
|
isAbsolute(pattern.map(function (p) {
|
||||||
|
return typeof p === 'string' ? p : '[*]'
|
||||||
|
}).join('/'))) {
|
||||||
|
if (!prefix || !isAbsolute(prefix))
|
||||||
|
prefix = '/' + prefix
|
||||||
|
read = prefix
|
||||||
|
} else
|
||||||
|
read = prefix
|
||||||
|
|
||||||
|
var abs = this._makeAbs(read)
|
||||||
|
|
||||||
|
//if ignored, skip processing
|
||||||
|
if (childrenIgnored(this, read))
|
||||||
|
return
|
||||||
|
|
||||||
|
var isGlobStar = remain[0] === minimatch.GLOBSTAR
|
||||||
|
if (isGlobStar)
|
||||||
|
this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
|
||||||
|
else
|
||||||
|
this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
|
||||||
|
var entries = this._readdir(abs, inGlobStar)
|
||||||
|
|
||||||
|
// if the abs isn't a dir, then nothing can match!
|
||||||
|
if (!entries)
|
||||||
|
return
|
||||||
|
|
||||||
|
// It will only match dot entries if it starts with a dot, or if
|
||||||
|
// dot is set. Stuff like @(.foo|.bar) isn't allowed.
|
||||||
|
var pn = remain[0]
|
||||||
|
var negate = !!this.minimatch.negate
|
||||||
|
var rawGlob = pn._glob
|
||||||
|
var dotOk = this.dot || rawGlob.charAt(0) === '.'
|
||||||
|
|
||||||
|
var matchedEntries = []
|
||||||
|
for (var i = 0; i < entries.length; i++) {
|
||||||
|
var e = entries[i]
|
||||||
|
if (e.charAt(0) !== '.' || dotOk) {
|
||||||
|
var m
|
||||||
|
if (negate && !prefix) {
|
||||||
|
m = !e.match(pn)
|
||||||
|
} else {
|
||||||
|
m = e.match(pn)
|
||||||
|
}
|
||||||
|
if (m)
|
||||||
|
matchedEntries.push(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var len = matchedEntries.length
|
||||||
|
// If there are no matched entries, then nothing matches.
|
||||||
|
if (len === 0)
|
||||||
|
return
|
||||||
|
|
||||||
|
// if this is the last remaining pattern bit, then no need for
|
||||||
|
// an additional stat *unless* the user has specified mark or
|
||||||
|
// stat explicitly. We know they exist, since readdir returned
|
||||||
|
// them.
|
||||||
|
|
||||||
|
if (remain.length === 1 && !this.mark && !this.stat) {
|
||||||
|
if (!this.matches[index])
|
||||||
|
this.matches[index] = Object.create(null)
|
||||||
|
|
||||||
|
for (var i = 0; i < len; i ++) {
|
||||||
|
var e = matchedEntries[i]
|
||||||
|
if (prefix) {
|
||||||
|
if (prefix.slice(-1) !== '/')
|
||||||
|
e = prefix + '/' + e
|
||||||
|
else
|
||||||
|
e = prefix + e
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.charAt(0) === '/' && !this.nomount) {
|
||||||
|
e = path.join(this.root, e)
|
||||||
|
}
|
||||||
|
this._emitMatch(index, e)
|
||||||
|
}
|
||||||
|
// This was the last one, and no stats were needed
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// now test all matched entries as stand-ins for that part
|
||||||
|
// of the pattern.
|
||||||
|
remain.shift()
|
||||||
|
for (var i = 0; i < len; i ++) {
|
||||||
|
var e = matchedEntries[i]
|
||||||
|
var newPattern
|
||||||
|
if (prefix)
|
||||||
|
newPattern = [prefix, e]
|
||||||
|
else
|
||||||
|
newPattern = [e]
|
||||||
|
this._process(newPattern.concat(remain), index, inGlobStar)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
GlobSync.prototype._emitMatch = function (index, e) {
|
||||||
|
if (isIgnored(this, e))
|
||||||
|
return
|
||||||
|
|
||||||
|
var abs = this._makeAbs(e)
|
||||||
|
|
||||||
|
if (this.mark)
|
||||||
|
e = this._mark(e)
|
||||||
|
|
||||||
|
if (this.absolute) {
|
||||||
|
e = abs
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.matches[index][e])
|
||||||
|
return
|
||||||
|
|
||||||
|
if (this.nodir) {
|
||||||
|
var c = this.cache[abs]
|
||||||
|
if (c === 'DIR' || Array.isArray(c))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.matches[index][e] = true
|
||||||
|
|
||||||
|
if (this.stat)
|
||||||
|
this._stat(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
GlobSync.prototype._readdirInGlobStar = function (abs) {
|
||||||
|
// follow all symlinked directories forever
|
||||||
|
// just proceed as if this is a non-globstar situation
|
||||||
|
if (this.follow)
|
||||||
|
return this._readdir(abs, false)
|
||||||
|
|
||||||
|
var entries
|
||||||
|
var lstat
|
||||||
|
var stat
|
||||||
|
try {
|
||||||
|
lstat = this.fs.lstatSync(abs)
|
||||||
|
} catch (er) {
|
||||||
|
if (er.code === 'ENOENT') {
|
||||||
|
// lstat failed, doesn't exist
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var isSym = lstat && lstat.isSymbolicLink()
|
||||||
|
this.symlinks[abs] = isSym
|
||||||
|
|
||||||
|
// If it's not a symlink or a dir, then it's definitely a regular file.
|
||||||
|
// don't bother doing a readdir in that case.
|
||||||
|
if (!isSym && lstat && !lstat.isDirectory())
|
||||||
|
this.cache[abs] = 'FILE'
|
||||||
|
else
|
||||||
|
entries = this._readdir(abs, false)
|
||||||
|
|
||||||
|
return entries
|
||||||
|
}
|
||||||
|
|
||||||
|
GlobSync.prototype._readdir = function (abs, inGlobStar) {
|
||||||
|
var entries
|
||||||
|
|
||||||
|
if (inGlobStar && !ownProp(this.symlinks, abs))
|
||||||
|
return this._readdirInGlobStar(abs)
|
||||||
|
|
||||||
|
if (ownProp(this.cache, abs)) {
|
||||||
|
var c = this.cache[abs]
|
||||||
|
if (!c || c === 'FILE')
|
||||||
|
return null
|
||||||
|
|
||||||
|
if (Array.isArray(c))
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
return this._readdirEntries(abs, this.fs.readdirSync(abs))
|
||||||
|
} catch (er) {
|
||||||
|
this._readdirError(abs, er)
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GlobSync.prototype._readdirEntries = function (abs, entries) {
|
||||||
|
// if we haven't asked to stat everything, then just
|
||||||
|
// assume that everything in there exists, so we can avoid
|
||||||
|
// having to stat it a second time.
|
||||||
|
if (!this.mark && !this.stat) {
|
||||||
|
for (var i = 0; i < entries.length; i ++) {
|
||||||
|
var e = entries[i]
|
||||||
|
if (abs === '/')
|
||||||
|
e = abs + e
|
||||||
|
else
|
||||||
|
e = abs + '/' + e
|
||||||
|
this.cache[e] = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.cache[abs] = entries
|
||||||
|
|
||||||
|
// mark and cache dir-ness
|
||||||
|
return entries
|
||||||
|
}
|
||||||
|
|
||||||
|
GlobSync.prototype._readdirError = function (f, er) {
|
||||||
|
// handle errors, and cache the information
|
||||||
|
switch (er.code) {
|
||||||
|
case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
|
||||||
|
case 'ENOTDIR': // totally normal. means it *does* exist.
|
||||||
|
var abs = this._makeAbs(f)
|
||||||
|
this.cache[abs] = 'FILE'
|
||||||
|
if (abs === this.cwdAbs) {
|
||||||
|
var error = new Error(er.code + ' invalid cwd ' + this.cwd)
|
||||||
|
error.path = this.cwd
|
||||||
|
error.code = er.code
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
break
|
||||||
|
|
||||||
|
case 'ENOENT': // not terribly unusual
|
||||||
|
case 'ELOOP':
|
||||||
|
case 'ENAMETOOLONG':
|
||||||
|
case 'UNKNOWN':
|
||||||
|
this.cache[this._makeAbs(f)] = false
|
||||||
|
break
|
||||||
|
|
||||||
|
default: // some unusual error. Treat as failure.
|
||||||
|
this.cache[this._makeAbs(f)] = false
|
||||||
|
if (this.strict)
|
||||||
|
throw er
|
||||||
|
if (!this.silent)
|
||||||
|
console.error('glob error', er)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
|
||||||
|
|
||||||
|
var entries = this._readdir(abs, inGlobStar)
|
||||||
|
|
||||||
|
// no entries means not a dir, so it can never have matches
|
||||||
|
// foo.txt/** doesn't match foo.txt
|
||||||
|
if (!entries)
|
||||||
|
return
|
||||||
|
|
||||||
|
// test without the globstar, and with every child both below
|
||||||
|
// and replacing the globstar.
|
||||||
|
var remainWithoutGlobStar = remain.slice(1)
|
||||||
|
var gspref = prefix ? [ prefix ] : []
|
||||||
|
var noGlobStar = gspref.concat(remainWithoutGlobStar)
|
||||||
|
|
||||||
|
// the noGlobStar pattern exits the inGlobStar state
|
||||||
|
this._process(noGlobStar, index, false)
|
||||||
|
|
||||||
|
var len = entries.length
|
||||||
|
var isSym = this.symlinks[abs]
|
||||||
|
|
||||||
|
// If it's a symlink, and we're in a globstar, then stop
|
||||||
|
if (isSym && inGlobStar)
|
||||||
|
return
|
||||||
|
|
||||||
|
for (var i = 0; i < len; i++) {
|
||||||
|
var e = entries[i]
|
||||||
|
if (e.charAt(0) === '.' && !this.dot)
|
||||||
|
continue
|
||||||
|
|
||||||
|
// these two cases enter the inGlobStar state
|
||||||
|
var instead = gspref.concat(entries[i], remainWithoutGlobStar)
|
||||||
|
this._process(instead, index, true)
|
||||||
|
|
||||||
|
var below = gspref.concat(entries[i], remain)
|
||||||
|
this._process(below, index, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GlobSync.prototype._processSimple = function (prefix, index) {
|
||||||
|
// XXX review this. Shouldn't it be doing the mounting etc
|
||||||
|
// before doing stat? kinda weird?
|
||||||
|
var exists = this._stat(prefix)
|
||||||
|
|
||||||
|
if (!this.matches[index])
|
||||||
|
this.matches[index] = Object.create(null)
|
||||||
|
|
||||||
|
// If it doesn't exist, then just mark the lack of results
|
||||||
|
if (!exists)
|
||||||
|
return
|
||||||
|
|
||||||
|
if (prefix && isAbsolute(prefix) && !this.nomount) {
|
||||||
|
var trail = /[\/\\]$/.test(prefix)
|
||||||
|
if (prefix.charAt(0) === '/') {
|
||||||
|
prefix = path.join(this.root, prefix)
|
||||||
|
} else {
|
||||||
|
prefix = path.resolve(this.root, prefix)
|
||||||
|
if (trail)
|
||||||
|
prefix += '/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.platform === 'win32')
|
||||||
|
prefix = prefix.replace(/\\/g, '/')
|
||||||
|
|
||||||
|
// Mark this as a match
|
||||||
|
this._emitMatch(index, prefix)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns either 'DIR', 'FILE', or false
|
||||||
|
GlobSync.prototype._stat = function (f) {
|
||||||
|
var abs = this._makeAbs(f)
|
||||||
|
var needDir = f.slice(-1) === '/'
|
||||||
|
|
||||||
|
if (f.length > this.maxLength)
|
||||||
|
return false
|
||||||
|
|
||||||
|
if (!this.stat && ownProp(this.cache, abs)) {
|
||||||
|
var c = this.cache[abs]
|
||||||
|
|
||||||
|
if (Array.isArray(c))
|
||||||
|
c = 'DIR'
|
||||||
|
|
||||||
|
// It exists, but maybe not how we need it
|
||||||
|
if (!needDir || c === 'DIR')
|
||||||
|
return c
|
||||||
|
|
||||||
|
if (needDir && c === 'FILE')
|
||||||
|
return false
|
||||||
|
|
||||||
|
// otherwise we have to stat, because maybe c=true
|
||||||
|
// if we know it exists, but not what it is.
|
||||||
|
}
|
||||||
|
|
||||||
|
var exists
|
||||||
|
var stat = this.statCache[abs]
|
||||||
|
if (!stat) {
|
||||||
|
var lstat
|
||||||
|
try {
|
||||||
|
lstat = this.fs.lstatSync(abs)
|
||||||
|
} catch (er) {
|
||||||
|
if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
|
||||||
|
this.statCache[abs] = false
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lstat && lstat.isSymbolicLink()) {
|
||||||
|
try {
|
||||||
|
stat = this.fs.statSync(abs)
|
||||||
|
} catch (er) {
|
||||||
|
stat = lstat
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
stat = lstat
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.statCache[abs] = stat
|
||||||
|
|
||||||
|
var c = true
|
||||||
|
if (stat)
|
||||||
|
c = stat.isDirectory() ? 'DIR' : 'FILE'
|
||||||
|
|
||||||
|
this.cache[abs] = this.cache[abs] || c
|
||||||
|
|
||||||
|
if (needDir && c === 'FILE')
|
||||||
|
return false
|
||||||
|
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
GlobSync.prototype._mark = function (p) {
|
||||||
|
return common.mark(this, p)
|
||||||
|
}
|
||||||
|
|
||||||
|
GlobSync.prototype._makeAbs = function (f) {
|
||||||
|
return common.makeAbs(this, f)
|
||||||
|
}
|
22
mybulma/node_modules/has/LICENSE-MIT
generated
vendored
Normal file
22
mybulma/node_modules/has/LICENSE-MIT
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
Copyright (c) 2013 Thiago de Arruda
|
||||||
|
|
||||||
|
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.
|
18
mybulma/node_modules/has/README.md
generated
vendored
Normal file
18
mybulma/node_modules/has/README.md
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# has
|
||||||
|
|
||||||
|
> Object.prototype.hasOwnProperty.call shortcut
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install --save has
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```js
|
||||||
|
var has = require('has');
|
||||||
|
|
||||||
|
has({}, 'hasOwnProperty'); // false
|
||||||
|
has(Object.prototype, 'hasOwnProperty'); // true
|
||||||
|
```
|
48
mybulma/node_modules/has/package.json
generated
vendored
Normal file
48
mybulma/node_modules/has/package.json
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
{
|
||||||
|
"name": "has",
|
||||||
|
"description": "Object.prototype.hasOwnProperty.call shortcut",
|
||||||
|
"version": "1.0.3",
|
||||||
|
"homepage": "https://github.com/tarruda/has",
|
||||||
|
"author": {
|
||||||
|
"name": "Thiago de Arruda",
|
||||||
|
"email": "tpadilha84@gmail.com"
|
||||||
|
},
|
||||||
|
"contributors": [
|
||||||
|
{
|
||||||
|
"name": "Jordan Harband",
|
||||||
|
"email": "ljharb@gmail.com",
|
||||||
|
"url": "http://ljharb.codes"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/tarruda/has.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/tarruda/has/issues"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"licenses": [
|
||||||
|
{
|
||||||
|
"type": "MIT",
|
||||||
|
"url": "https://github.com/tarruda/has/blob/master/LICENSE-MIT"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"main": "./src",
|
||||||
|
"dependencies": {
|
||||||
|
"function-bind": "^1.1.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@ljharb/eslint-config": "^12.2.1",
|
||||||
|
"eslint": "^4.19.1",
|
||||||
|
"tape": "^4.9.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4.0"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint .",
|
||||||
|
"pretest": "npm run lint",
|
||||||
|
"test": "tape test"
|
||||||
|
}
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue