$
This commit is contained in:
197
node_modules/nyc/node_modules/ansi-styles/index.d.ts
generated
vendored
Normal file
197
node_modules/nyc/node_modules/ansi-styles/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,197 @@
|
||||
import * as cssColors from 'color-name';
|
||||
|
||||
declare namespace ansiStyles {
|
||||
interface ColorConvert {
|
||||
/**
|
||||
The RGB color space.
|
||||
|
||||
@param red - (`0`-`255`)
|
||||
@param green - (`0`-`255`)
|
||||
@param blue - (`0`-`255`)
|
||||
*/
|
||||
rgb(red: number, green: number, blue: number): string;
|
||||
|
||||
/**
|
||||
The RGB HEX color space.
|
||||
|
||||
@param hex - A hexadecimal string containing RGB data.
|
||||
*/
|
||||
hex(hex: string): string;
|
||||
|
||||
/**
|
||||
@param keyword - A CSS color name.
|
||||
*/
|
||||
keyword(keyword: keyof typeof cssColors): string;
|
||||
|
||||
/**
|
||||
The HSL color space.
|
||||
|
||||
@param hue - (`0`-`360`)
|
||||
@param saturation - (`0`-`100`)
|
||||
@param lightness - (`0`-`100`)
|
||||
*/
|
||||
hsl(hue: number, saturation: number, lightness: number): string;
|
||||
|
||||
/**
|
||||
The HSV color space.
|
||||
|
||||
@param hue - (`0`-`360`)
|
||||
@param saturation - (`0`-`100`)
|
||||
@param value - (`0`-`100`)
|
||||
*/
|
||||
hsv(hue: number, saturation: number, value: number): string;
|
||||
|
||||
/**
|
||||
The HSV color space.
|
||||
|
||||
@param hue - (`0`-`360`)
|
||||
@param whiteness - (`0`-`100`)
|
||||
@param blackness - (`0`-`100`)
|
||||
*/
|
||||
hwb(hue: number, whiteness: number, blackness: number): string;
|
||||
|
||||
/**
|
||||
Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color.
|
||||
*/
|
||||
ansi(ansi: number): string;
|
||||
|
||||
/**
|
||||
Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
|
||||
*/
|
||||
ansi256(ansi: number): string;
|
||||
}
|
||||
|
||||
interface CSPair {
|
||||
/**
|
||||
The ANSI terminal control sequence for starting this style.
|
||||
*/
|
||||
readonly open: string;
|
||||
|
||||
/**
|
||||
The ANSI terminal control sequence for ending this style.
|
||||
*/
|
||||
readonly close: string;
|
||||
}
|
||||
|
||||
interface ColorBase {
|
||||
readonly ansi: ColorConvert;
|
||||
readonly ansi256: ColorConvert;
|
||||
readonly ansi16m: ColorConvert;
|
||||
|
||||
/**
|
||||
The ANSI terminal control sequence for ending this color.
|
||||
*/
|
||||
readonly close: string;
|
||||
}
|
||||
|
||||
interface Modifier {
|
||||
/**
|
||||
Resets the current color chain.
|
||||
*/
|
||||
readonly reset: CSPair;
|
||||
|
||||
/**
|
||||
Make text bold.
|
||||
*/
|
||||
readonly bold: CSPair;
|
||||
|
||||
/**
|
||||
Emitting only a small amount of light.
|
||||
*/
|
||||
readonly dim: CSPair;
|
||||
|
||||
/**
|
||||
Make text italic. (Not widely supported)
|
||||
*/
|
||||
readonly italic: CSPair;
|
||||
|
||||
/**
|
||||
Make text underline. (Not widely supported)
|
||||
*/
|
||||
readonly underline: CSPair;
|
||||
|
||||
/**
|
||||
Inverse background and foreground colors.
|
||||
*/
|
||||
readonly inverse: CSPair;
|
||||
|
||||
/**
|
||||
Prints the text, but makes it invisible.
|
||||
*/
|
||||
readonly hidden: CSPair;
|
||||
|
||||
/**
|
||||
Puts a horizontal line through the center of the text. (Not widely supported)
|
||||
*/
|
||||
readonly strikethrough: CSPair;
|
||||
}
|
||||
|
||||
interface ForegroundColor {
|
||||
readonly black: CSPair;
|
||||
readonly red: CSPair;
|
||||
readonly green: CSPair;
|
||||
readonly yellow: CSPair;
|
||||
readonly blue: CSPair;
|
||||
readonly cyan: CSPair;
|
||||
readonly magenta: CSPair;
|
||||
readonly white: CSPair;
|
||||
|
||||
/**
|
||||
Alias for `blackBright`.
|
||||
*/
|
||||
readonly gray: CSPair;
|
||||
|
||||
/**
|
||||
Alias for `blackBright`.
|
||||
*/
|
||||
readonly grey: CSPair;
|
||||
|
||||
readonly blackBright: CSPair;
|
||||
readonly redBright: CSPair;
|
||||
readonly greenBright: CSPair;
|
||||
readonly yellowBright: CSPair;
|
||||
readonly blueBright: CSPair;
|
||||
readonly cyanBright: CSPair;
|
||||
readonly magentaBright: CSPair;
|
||||
readonly whiteBright: CSPair;
|
||||
}
|
||||
|
||||
interface BackgroundColor {
|
||||
readonly bgBlack: CSPair;
|
||||
readonly bgRed: CSPair;
|
||||
readonly bgGreen: CSPair;
|
||||
readonly bgYellow: CSPair;
|
||||
readonly bgBlue: CSPair;
|
||||
readonly bgCyan: CSPair;
|
||||
readonly bgMagenta: CSPair;
|
||||
readonly bgWhite: CSPair;
|
||||
|
||||
/**
|
||||
Alias for `bgBlackBright`.
|
||||
*/
|
||||
readonly bgGray: CSPair;
|
||||
|
||||
/**
|
||||
Alias for `bgBlackBright`.
|
||||
*/
|
||||
readonly bgGrey: CSPair;
|
||||
|
||||
readonly bgBlackBright: CSPair;
|
||||
readonly bgRedBright: CSPair;
|
||||
readonly bgGreenBright: CSPair;
|
||||
readonly bgYellowBright: CSPair;
|
||||
readonly bgBlueBright: CSPair;
|
||||
readonly bgCyanBright: CSPair;
|
||||
readonly bgMagentaBright: CSPair;
|
||||
readonly bgWhiteBright: CSPair;
|
||||
}
|
||||
}
|
||||
|
||||
declare const ansiStyles: {
|
||||
readonly modifier: ansiStyles.Modifier;
|
||||
readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase;
|
||||
readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase;
|
||||
readonly codes: ReadonlyMap<number, number>;
|
||||
} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier;
|
||||
|
||||
export = ansiStyles;
|
163
node_modules/nyc/node_modules/ansi-styles/index.js
generated
vendored
Normal file
163
node_modules/nyc/node_modules/ansi-styles/index.js
generated
vendored
Normal file
@@ -0,0 +1,163 @@
|
||||
'use strict';
|
||||
|
||||
const wrapAnsi16 = (fn, offset) => (...args) => {
|
||||
const code = fn(...args);
|
||||
return `\u001B[${code + offset}m`;
|
||||
};
|
||||
|
||||
const wrapAnsi256 = (fn, offset) => (...args) => {
|
||||
const code = fn(...args);
|
||||
return `\u001B[${38 + offset};5;${code}m`;
|
||||
};
|
||||
|
||||
const wrapAnsi16m = (fn, offset) => (...args) => {
|
||||
const rgb = fn(...args);
|
||||
return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
||||
};
|
||||
|
||||
const ansi2ansi = n => n;
|
||||
const rgb2rgb = (r, g, b) => [r, g, b];
|
||||
|
||||
const setLazyProperty = (object, property, get) => {
|
||||
Object.defineProperty(object, property, {
|
||||
get: () => {
|
||||
const value = get();
|
||||
|
||||
Object.defineProperty(object, property, {
|
||||
value,
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
return value;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
};
|
||||
|
||||
/** @type {typeof import('color-convert')} */
|
||||
let colorConvert;
|
||||
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
||||
if (colorConvert === undefined) {
|
||||
colorConvert = require('color-convert');
|
||||
}
|
||||
|
||||
const offset = isBackground ? 10 : 0;
|
||||
const styles = {};
|
||||
|
||||
for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
|
||||
const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace;
|
||||
if (sourceSpace === targetSpace) {
|
||||
styles[name] = wrap(identity, offset);
|
||||
} else if (typeof suite === 'object') {
|
||||
styles[name] = wrap(suite[targetSpace], offset);
|
||||
}
|
||||
}
|
||||
|
||||
return styles;
|
||||
};
|
||||
|
||||
function assembleStyles() {
|
||||
const codes = new Map();
|
||||
const styles = {
|
||||
modifier: {
|
||||
reset: [0, 0],
|
||||
// 21 isn't widely supported and 22 does the same thing
|
||||
bold: [1, 22],
|
||||
dim: [2, 22],
|
||||
italic: [3, 23],
|
||||
underline: [4, 24],
|
||||
inverse: [7, 27],
|
||||
hidden: [8, 28],
|
||||
strikethrough: [9, 29]
|
||||
},
|
||||
color: {
|
||||
black: [30, 39],
|
||||
red: [31, 39],
|
||||
green: [32, 39],
|
||||
yellow: [33, 39],
|
||||
blue: [34, 39],
|
||||
magenta: [35, 39],
|
||||
cyan: [36, 39],
|
||||
white: [37, 39],
|
||||
|
||||
// Bright color
|
||||
blackBright: [90, 39],
|
||||
redBright: [91, 39],
|
||||
greenBright: [92, 39],
|
||||
yellowBright: [93, 39],
|
||||
blueBright: [94, 39],
|
||||
magentaBright: [95, 39],
|
||||
cyanBright: [96, 39],
|
||||
whiteBright: [97, 39]
|
||||
},
|
||||
bgColor: {
|
||||
bgBlack: [40, 49],
|
||||
bgRed: [41, 49],
|
||||
bgGreen: [42, 49],
|
||||
bgYellow: [43, 49],
|
||||
bgBlue: [44, 49],
|
||||
bgMagenta: [45, 49],
|
||||
bgCyan: [46, 49],
|
||||
bgWhite: [47, 49],
|
||||
|
||||
// Bright color
|
||||
bgBlackBright: [100, 49],
|
||||
bgRedBright: [101, 49],
|
||||
bgGreenBright: [102, 49],
|
||||
bgYellowBright: [103, 49],
|
||||
bgBlueBright: [104, 49],
|
||||
bgMagentaBright: [105, 49],
|
||||
bgCyanBright: [106, 49],
|
||||
bgWhiteBright: [107, 49]
|
||||
}
|
||||
};
|
||||
|
||||
// Alias bright black as gray (and grey)
|
||||
styles.color.gray = styles.color.blackBright;
|
||||
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
||||
styles.color.grey = styles.color.blackBright;
|
||||
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
||||
|
||||
for (const [groupName, group] of Object.entries(styles)) {
|
||||
for (const [styleName, style] of Object.entries(group)) {
|
||||
styles[styleName] = {
|
||||
open: `\u001B[${style[0]}m`,
|
||||
close: `\u001B[${style[1]}m`
|
||||
};
|
||||
|
||||
group[styleName] = styles[styleName];
|
||||
|
||||
codes.set(style[0], style[1]);
|
||||
}
|
||||
|
||||
Object.defineProperty(styles, groupName, {
|
||||
value: group,
|
||||
enumerable: false
|
||||
});
|
||||
}
|
||||
|
||||
Object.defineProperty(styles, 'codes', {
|
||||
value: codes,
|
||||
enumerable: false
|
||||
});
|
||||
|
||||
styles.color.close = '\u001B[39m';
|
||||
styles.bgColor.close = '\u001B[49m';
|
||||
|
||||
setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false));
|
||||
setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false));
|
||||
setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false));
|
||||
setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true));
|
||||
setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true));
|
||||
setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true));
|
||||
|
||||
return styles;
|
||||
}
|
||||
|
||||
// Make the export immutable
|
||||
Object.defineProperty(module, 'exports', {
|
||||
enumerable: true,
|
||||
get: assembleStyles
|
||||
});
|
9
node_modules/nyc/node_modules/ansi-styles/license
generated
vendored
Normal file
9
node_modules/nyc/node_modules/ansi-styles/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.
|
57
node_modules/nyc/node_modules/ansi-styles/package.json
generated
vendored
Normal file
57
node_modules/nyc/node_modules/ansi-styles/package.json
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"name": "ansi-styles",
|
||||
"version": "4.2.1",
|
||||
"description": "ANSI escape codes for styling strings in the terminal",
|
||||
"license": "MIT",
|
||||
"repository": "chalk/ansi-styles",
|
||||
"funding": "https://github.com/chalk/ansi-styles?sponsor=1",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd",
|
||||
"screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"styles",
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"tty",
|
||||
"escape",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"log",
|
||||
"logging",
|
||||
"command-line",
|
||||
"text"
|
||||
],
|
||||
"dependencies": {
|
||||
"@types/color-name": "^1.1.1",
|
||||
"color-convert": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/color-convert": "^1.9.0",
|
||||
"ava": "^2.3.0",
|
||||
"svg-term-cli": "^2.1.1",
|
||||
"tsd": "^0.11.0",
|
||||
"xo": "^0.25.3"
|
||||
}
|
||||
}
|
158
node_modules/nyc/node_modules/ansi-styles/readme.md
generated
vendored
Normal file
158
node_modules/nyc/node_modules/ansi-styles/readme.md
generated
vendored
Normal file
@@ -0,0 +1,158 @@
|
||||
# ansi-styles [](https://travis-ci.org/chalk/ansi-styles)
|
||||
|
||||
> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
|
||||
|
||||
You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
|
||||
|
||||
<img src="screenshot.svg" width="900">
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install ansi-styles
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const style = require('ansi-styles');
|
||||
|
||||
console.log(`${style.green.open}Hello world!${style.green.close}`);
|
||||
|
||||
|
||||
// Color conversion between 16/256/truecolor
|
||||
// NOTE: If conversion goes to 16 colors or 256 colors, the original color
|
||||
// may be degraded to fit that color palette. This means terminals
|
||||
// that do not support 16 million colors will best-match the
|
||||
// original color.
|
||||
console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close);
|
||||
console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close);
|
||||
console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close);
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
Each style has an `open` and `close` property.
|
||||
|
||||
## Styles
|
||||
|
||||
### Modifiers
|
||||
|
||||
- `reset`
|
||||
- `bold`
|
||||
- `dim`
|
||||
- `italic` *(Not widely supported)*
|
||||
- `underline`
|
||||
- `inverse`
|
||||
- `hidden`
|
||||
- `strikethrough` *(Not widely supported)*
|
||||
|
||||
### 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`
|
||||
|
||||
## Advanced usage
|
||||
|
||||
By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
|
||||
|
||||
- `style.modifier`
|
||||
- `style.color`
|
||||
- `style.bgColor`
|
||||
|
||||
###### Example
|
||||
|
||||
```js
|
||||
console.log(style.color.green.open);
|
||||
```
|
||||
|
||||
Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values.
|
||||
|
||||
###### Example
|
||||
|
||||
```js
|
||||
console.log(style.codes.get(36));
|
||||
//=> 39
|
||||
```
|
||||
|
||||
## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728)
|
||||
|
||||
`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors.
|
||||
|
||||
The following color spaces from `color-convert` are supported:
|
||||
|
||||
- `rgb`
|
||||
- `hex`
|
||||
- `keyword`
|
||||
- `hsl`
|
||||
- `hsv`
|
||||
- `hwb`
|
||||
- `ansi`
|
||||
- `ansi256`
|
||||
|
||||
To use these, call the associated conversion function with the intended output, for example:
|
||||
|
||||
```js
|
||||
style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code
|
||||
style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code
|
||||
|
||||
style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
|
||||
style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
|
||||
|
||||
style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code
|
||||
style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
76
node_modules/nyc/node_modules/cliui/CHANGELOG.md
generated
vendored
Normal file
76
node_modules/nyc/node_modules/cliui/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [6.0.0](https://www.github.com/yargs/cliui/compare/v5.0.0...v6.0.0) (2019-11-10)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* update deps, drop Node 6
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* update deps, drop Node 6 ([62056df](https://www.github.com/yargs/cliui/commit/62056df))
|
||||
|
||||
## [5.0.0](https://github.com/yargs/cliui/compare/v4.1.0...v5.0.0) (2019-04-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Update wrap-ansi to fix compatibility with latest versions of chalk. ([#60](https://github.com/yargs/cliui/issues/60)) ([7bf79ae](https://github.com/yargs/cliui/commit/7bf79ae))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Drop support for node < 6.
|
||||
|
||||
|
||||
|
||||
<a name="4.1.0"></a>
|
||||
## [4.1.0](https://github.com/yargs/cliui/compare/v4.0.0...v4.1.0) (2018-04-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add resetOutput method ([#57](https://github.com/yargs/cliui/issues/57)) ([7246902](https://github.com/yargs/cliui/commit/7246902))
|
||||
|
||||
|
||||
|
||||
<a name="4.0.0"></a>
|
||||
## [4.0.0](https://github.com/yargs/cliui/compare/v3.2.0...v4.0.0) (2017-12-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* downgrades strip-ansi to version 3.0.1 ([#54](https://github.com/yargs/cliui/issues/54)) ([5764c46](https://github.com/yargs/cliui/commit/5764c46))
|
||||
* set env variable FORCE_COLOR. ([#56](https://github.com/yargs/cliui/issues/56)) ([7350e36](https://github.com/yargs/cliui/commit/7350e36))
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* drop support for node < 4 ([#53](https://github.com/yargs/cliui/issues/53)) ([b105376](https://github.com/yargs/cliui/commit/b105376))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add fallback for window width ([#45](https://github.com/yargs/cliui/issues/45)) ([d064922](https://github.com/yargs/cliui/commit/d064922))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* officially drop support for Node < 4
|
||||
|
||||
|
||||
|
||||
<a name="3.2.0"></a>
|
||||
## [3.2.0](https://github.com/yargs/cliui/compare/v3.1.2...v3.2.0) (2016-04-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* reduces tarball size ([acc6c33](https://github.com/yargs/cliui/commit/acc6c33))
|
||||
|
||||
### Features
|
||||
|
||||
* adds standard-version for release management ([ff84e32](https://github.com/yargs/cliui/commit/ff84e32))
|
14
node_modules/nyc/node_modules/cliui/LICENSE.txt
generated
vendored
Normal file
14
node_modules/nyc/node_modules/cliui/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
Copyright (c) 2015, 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.
|
115
node_modules/nyc/node_modules/cliui/README.md
generated
vendored
Normal file
115
node_modules/nyc/node_modules/cliui/README.md
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
# cliui
|
||||
|
||||
[](https://travis-ci.org/yargs/cliui)
|
||||
[](https://coveralls.io/r/yargs/cliui?branch=)
|
||||
[](https://www.npmjs.com/package/cliui)
|
||||
[](https://github.com/conventional-changelog/standard-version)
|
||||
|
||||
easily create complex multi-column command-line-interfaces.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var ui = require('cliui')()
|
||||
|
||||
ui.div('Usage: $0 [command] [options]')
|
||||
|
||||
ui.div({
|
||||
text: 'Options:',
|
||||
padding: [2, 0, 2, 0]
|
||||
})
|
||||
|
||||
ui.div(
|
||||
{
|
||||
text: "-f, --file",
|
||||
width: 20,
|
||||
padding: [0, 4, 0, 4]
|
||||
},
|
||||
{
|
||||
text: "the file to load." +
|
||||
chalk.green("(if this description is long it wraps).")
|
||||
,
|
||||
width: 20
|
||||
},
|
||||
{
|
||||
text: chalk.red("[required]"),
|
||||
align: 'right'
|
||||
}
|
||||
)
|
||||
|
||||
console.log(ui.toString())
|
||||
```
|
||||
|
||||
<img width="500" src="screenshot.png">
|
||||
|
||||
## Layout DSL
|
||||
|
||||
cliui exposes a simple layout DSL:
|
||||
|
||||
If you create a single `ui.div`, passing a string rather than an
|
||||
object:
|
||||
|
||||
* `\n`: characters will be interpreted as new rows.
|
||||
* `\t`: characters will be interpreted as new columns.
|
||||
* `\s`: characters will be interpreted as padding.
|
||||
|
||||
**as an example...**
|
||||
|
||||
```js
|
||||
var ui = require('./')({
|
||||
width: 60
|
||||
})
|
||||
|
||||
ui.div(
|
||||
'Usage: node ./bin/foo.js\n' +
|
||||
' <regex>\t provide a regex\n' +
|
||||
' <glob>\t provide a glob\t [required]'
|
||||
)
|
||||
|
||||
console.log(ui.toString())
|
||||
```
|
||||
|
||||
**will output:**
|
||||
|
||||
```shell
|
||||
Usage: node ./bin/foo.js
|
||||
<regex> provide a regex
|
||||
<glob> provide a glob [required]
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
||||
```js
|
||||
cliui = require('cliui')
|
||||
```
|
||||
|
||||
### cliui({width: integer})
|
||||
|
||||
Specify the maximum width of the UI being generated.
|
||||
If no width is provided, cliui will try to get the current window's width and use it, and if that doesn't work, width will be set to `80`.
|
||||
|
||||
### cliui({wrap: boolean})
|
||||
|
||||
Enable or disable the wrapping of text in a column.
|
||||
|
||||
### cliui.div(column, column, column)
|
||||
|
||||
Create a row with any number of columns, a column
|
||||
can either be a string, or an object with the following
|
||||
options:
|
||||
|
||||
* **text:** some text to place in the column.
|
||||
* **width:** the width of a column.
|
||||
* **align:** alignment, `right` or `center`.
|
||||
* **padding:** `[top, right, bottom, left]`.
|
||||
* **border:** should a border be placed around the div?
|
||||
|
||||
### cliui.span(column, column, column)
|
||||
|
||||
Similar to `div`, except the next row will be appended without
|
||||
a new line being created.
|
||||
|
||||
### cliui.resetOutput()
|
||||
|
||||
Resets the UI elements of the current cliui instance, maintaining the values
|
||||
set for `width` and `wrap`.
|
354
node_modules/nyc/node_modules/cliui/index.js
generated
vendored
Normal file
354
node_modules/nyc/node_modules/cliui/index.js
generated
vendored
Normal file
@@ -0,0 +1,354 @@
|
||||
'use strict'
|
||||
|
||||
const stringWidth = require('string-width')
|
||||
const stripAnsi = require('strip-ansi')
|
||||
const wrap = require('wrap-ansi')
|
||||
|
||||
const align = {
|
||||
right: alignRight,
|
||||
center: alignCenter
|
||||
}
|
||||
const top = 0
|
||||
const right = 1
|
||||
const bottom = 2
|
||||
const left = 3
|
||||
|
||||
class UI {
|
||||
constructor (opts) {
|
||||
this.width = opts.width
|
||||
this.wrap = opts.wrap
|
||||
this.rows = []
|
||||
}
|
||||
|
||||
span (...args) {
|
||||
const cols = this.div(...args)
|
||||
cols.span = true
|
||||
}
|
||||
|
||||
resetOutput () {
|
||||
this.rows = []
|
||||
}
|
||||
|
||||
div (...args) {
|
||||
if (args.length === 0) {
|
||||
this.div('')
|
||||
}
|
||||
|
||||
if (this.wrap && this._shouldApplyLayoutDSL(...args)) {
|
||||
return this._applyLayoutDSL(args[0])
|
||||
}
|
||||
|
||||
const cols = args.map(arg => {
|
||||
if (typeof arg === 'string') {
|
||||
return this._colFromString(arg)
|
||||
}
|
||||
|
||||
return arg
|
||||
})
|
||||
|
||||
this.rows.push(cols)
|
||||
return cols
|
||||
}
|
||||
|
||||
_shouldApplyLayoutDSL (...args) {
|
||||
return args.length === 1 && typeof args[0] === 'string' &&
|
||||
/[\t\n]/.test(args[0])
|
||||
}
|
||||
|
||||
_applyLayoutDSL (str) {
|
||||
const rows = str.split('\n').map(row => row.split('\t'))
|
||||
let leftColumnWidth = 0
|
||||
|
||||
// simple heuristic for layout, make sure the
|
||||
// second column lines up along the left-hand.
|
||||
// don't allow the first column to take up more
|
||||
// than 50% of the screen.
|
||||
rows.forEach(columns => {
|
||||
if (columns.length > 1 && stringWidth(columns[0]) > leftColumnWidth) {
|
||||
leftColumnWidth = Math.min(
|
||||
Math.floor(this.width * 0.5),
|
||||
stringWidth(columns[0])
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
// generate a table:
|
||||
// replacing ' ' with padding calculations.
|
||||
// using the algorithmically generated width.
|
||||
rows.forEach(columns => {
|
||||
this.div(...columns.map((r, i) => {
|
||||
return {
|
||||
text: r.trim(),
|
||||
padding: this._measurePadding(r),
|
||||
width: (i === 0 && columns.length > 1) ? leftColumnWidth : undefined
|
||||
}
|
||||
}))
|
||||
})
|
||||
|
||||
return this.rows[this.rows.length - 1]
|
||||
}
|
||||
|
||||
_colFromString (text) {
|
||||
return {
|
||||
text,
|
||||
padding: this._measurePadding(text)
|
||||
}
|
||||
}
|
||||
|
||||
_measurePadding (str) {
|
||||
// measure padding without ansi escape codes
|
||||
const noAnsi = stripAnsi(str)
|
||||
return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length]
|
||||
}
|
||||
|
||||
toString () {
|
||||
const lines = []
|
||||
|
||||
this.rows.forEach(row => {
|
||||
this.rowToString(row, lines)
|
||||
})
|
||||
|
||||
// don't display any lines with the
|
||||
// hidden flag set.
|
||||
return lines
|
||||
.filter(line => !line.hidden)
|
||||
.map(line => line.text)
|
||||
.join('\n')
|
||||
}
|
||||
|
||||
rowToString (row, lines) {
|
||||
this._rasterize(row).forEach((rrow, r) => {
|
||||
let str = ''
|
||||
rrow.forEach((col, c) => {
|
||||
const { width } = row[c] // the width with padding.
|
||||
const wrapWidth = this._negatePadding(row[c]) // the width without padding.
|
||||
|
||||
let ts = col // temporary string used during alignment/padding.
|
||||
|
||||
if (wrapWidth > stringWidth(col)) {
|
||||
ts += ' '.repeat(wrapWidth - stringWidth(col))
|
||||
}
|
||||
|
||||
// align the string within its column.
|
||||
if (row[c].align && row[c].align !== 'left' && this.wrap) {
|
||||
ts = align[row[c].align](ts, wrapWidth)
|
||||
if (stringWidth(ts) < wrapWidth) {
|
||||
ts += ' '.repeat(width - stringWidth(ts) - 1)
|
||||
}
|
||||
}
|
||||
|
||||
// apply border and padding to string.
|
||||
const padding = row[c].padding || [0, 0, 0, 0]
|
||||
if (padding[left]) {
|
||||
str += ' '.repeat(padding[left])
|
||||
}
|
||||
|
||||
str += addBorder(row[c], ts, '| ')
|
||||
str += ts
|
||||
str += addBorder(row[c], ts, ' |')
|
||||
if (padding[right]) {
|
||||
str += ' '.repeat(padding[right])
|
||||
}
|
||||
|
||||
// if prior row is span, try to render the
|
||||
// current row on the prior line.
|
||||
if (r === 0 && lines.length > 0) {
|
||||
str = this._renderInline(str, lines[lines.length - 1])
|
||||
}
|
||||
})
|
||||
|
||||
// remove trailing whitespace.
|
||||
lines.push({
|
||||
text: str.replace(/ +$/, ''),
|
||||
span: row.span
|
||||
})
|
||||
})
|
||||
|
||||
return lines
|
||||
}
|
||||
|
||||
// if the full 'source' can render in
|
||||
// the target line, do so.
|
||||
_renderInline (source, previousLine) {
|
||||
const leadingWhitespace = source.match(/^ */)[0].length
|
||||
const target = previousLine.text
|
||||
const targetTextWidth = stringWidth(target.trimRight())
|
||||
|
||||
if (!previousLine.span) {
|
||||
return source
|
||||
}
|
||||
|
||||
// if we're not applying wrapping logic,
|
||||
// just always append to the span.
|
||||
if (!this.wrap) {
|
||||
previousLine.hidden = true
|
||||
return target + source
|
||||
}
|
||||
|
||||
if (leadingWhitespace < targetTextWidth) {
|
||||
return source
|
||||
}
|
||||
|
||||
previousLine.hidden = true
|
||||
|
||||
return target.trimRight() + ' '.repeat(leadingWhitespace - targetTextWidth) + source.trimLeft()
|
||||
}
|
||||
|
||||
_rasterize (row) {
|
||||
const rrows = []
|
||||
const widths = this._columnWidths(row)
|
||||
let wrapped
|
||||
|
||||
// word wrap all columns, and create
|
||||
// a data-structure that is easy to rasterize.
|
||||
row.forEach((col, c) => {
|
||||
// leave room for left and right padding.
|
||||
col.width = widths[c]
|
||||
if (this.wrap) {
|
||||
wrapped = wrap(col.text, this._negatePadding(col), { hard: true }).split('\n')
|
||||
} else {
|
||||
wrapped = col.text.split('\n')
|
||||
}
|
||||
|
||||
if (col.border) {
|
||||
wrapped.unshift('.' + '-'.repeat(this._negatePadding(col) + 2) + '.')
|
||||
wrapped.push("'" + '-'.repeat(this._negatePadding(col) + 2) + "'")
|
||||
}
|
||||
|
||||
// add top and bottom padding.
|
||||
if (col.padding) {
|
||||
wrapped.unshift(...new Array(col.padding[top] || 0).fill(''))
|
||||
wrapped.push(...new Array(col.padding[bottom] || 0).fill(''))
|
||||
}
|
||||
|
||||
wrapped.forEach((str, r) => {
|
||||
if (!rrows[r]) {
|
||||
rrows.push([])
|
||||
}
|
||||
|
||||
const rrow = rrows[r]
|
||||
|
||||
for (let i = 0; i < c; i++) {
|
||||
if (rrow[i] === undefined) {
|
||||
rrow.push('')
|
||||
}
|
||||
}
|
||||
|
||||
rrow.push(str)
|
||||
})
|
||||
})
|
||||
|
||||
return rrows
|
||||
}
|
||||
|
||||
_negatePadding (col) {
|
||||
let wrapWidth = col.width
|
||||
if (col.padding) {
|
||||
wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0)
|
||||
}
|
||||
|
||||
if (col.border) {
|
||||
wrapWidth -= 4
|
||||
}
|
||||
|
||||
return wrapWidth
|
||||
}
|
||||
|
||||
_columnWidths (row) {
|
||||
if (!this.wrap) {
|
||||
return row.map(col => {
|
||||
return col.width || stringWidth(col.text)
|
||||
})
|
||||
}
|
||||
|
||||
let unset = row.length
|
||||
let remainingWidth = this.width
|
||||
|
||||
// column widths can be set in config.
|
||||
const widths = row.map(col => {
|
||||
if (col.width) {
|
||||
unset--
|
||||
remainingWidth -= col.width
|
||||
return col.width
|
||||
}
|
||||
|
||||
return undefined
|
||||
})
|
||||
|
||||
// any unset widths should be calculated.
|
||||
const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0
|
||||
|
||||
return widths.map((w, i) => {
|
||||
if (w === undefined) {
|
||||
return Math.max(unsetWidth, _minWidth(row[i]))
|
||||
}
|
||||
|
||||
return w
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function addBorder (col, ts, style) {
|
||||
if (col.border) {
|
||||
if (/[.']-+[.']/.test(ts)) {
|
||||
return ''
|
||||
}
|
||||
|
||||
if (ts.trim().length !== 0) {
|
||||
return style
|
||||
}
|
||||
|
||||
return ' '
|
||||
}
|
||||
|
||||
return ''
|
||||
}
|
||||
|
||||
// calculates the minimum width of
|
||||
// a column, based on padding preferences.
|
||||
function _minWidth (col) {
|
||||
const padding = col.padding || []
|
||||
const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0)
|
||||
if (col.border) {
|
||||
return minWidth + 4
|
||||
}
|
||||
|
||||
return minWidth
|
||||
}
|
||||
|
||||
function getWindowWidth () {
|
||||
/* istanbul ignore next: depends on terminal */
|
||||
if (typeof process === 'object' && process.stdout && process.stdout.columns) {
|
||||
return process.stdout.columns
|
||||
}
|
||||
}
|
||||
|
||||
function alignRight (str, width) {
|
||||
str = str.trim()
|
||||
const strWidth = stringWidth(str)
|
||||
|
||||
if (strWidth < width) {
|
||||
return ' '.repeat(width - strWidth) + str
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
function alignCenter (str, width) {
|
||||
str = str.trim()
|
||||
const strWidth = stringWidth(str)
|
||||
|
||||
/* istanbul ignore next */
|
||||
if (strWidth >= width) {
|
||||
return str
|
||||
}
|
||||
|
||||
return ' '.repeat((width - strWidth) >> 1) + str
|
||||
}
|
||||
|
||||
module.exports = function (opts = {}) {
|
||||
return new UI({
|
||||
width: opts.width || getWindowWidth() || /* istanbul ignore next */ 80,
|
||||
wrap: opts.wrap !== false
|
||||
})
|
||||
}
|
65
node_modules/nyc/node_modules/cliui/package.json
generated
vendored
Normal file
65
node_modules/nyc/node_modules/cliui/package.json
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "cliui",
|
||||
"version": "6.0.0",
|
||||
"description": "easily create complex multi-column command-line-interfaces",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"pretest": "standard",
|
||||
"test": "nyc mocha",
|
||||
"coverage": "nyc --reporter=text-lcov mocha | coveralls"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/yargs/cliui.git"
|
||||
},
|
||||
"config": {
|
||||
"blanket": {
|
||||
"pattern": [
|
||||
"index.js"
|
||||
],
|
||||
"data-cover-never": [
|
||||
"node_modules",
|
||||
"test"
|
||||
],
|
||||
"output-reporter": "spec"
|
||||
}
|
||||
},
|
||||
"standard": {
|
||||
"ignore": [
|
||||
"**/example/**"
|
||||
],
|
||||
"globals": [
|
||||
"it"
|
||||
]
|
||||
},
|
||||
"keywords": [
|
||||
"cli",
|
||||
"command-line",
|
||||
"layout",
|
||||
"design",
|
||||
"console",
|
||||
"wrap",
|
||||
"table"
|
||||
],
|
||||
"author": "Ben Coe <ben@npmjs.com>",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"string-width": "^4.2.0",
|
||||
"strip-ansi": "^6.0.0",
|
||||
"wrap-ansi": "^6.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^4.2.0",
|
||||
"chalk": "^3.0.0",
|
||||
"coveralls": "^3.0.3",
|
||||
"mocha": "^6.2.2",
|
||||
"nyc": "^14.1.1",
|
||||
"standard": "^12.0.1"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"engine": {
|
||||
"node": ">=8"
|
||||
}
|
||||
}
|
54
node_modules/nyc/node_modules/color-convert/CHANGELOG.md
generated
vendored
Normal file
54
node_modules/nyc/node_modules/color-convert/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
# 1.0.0 - 2016-01-07
|
||||
|
||||
- Removed: unused speed test
|
||||
- Added: Automatic routing between previously unsupported conversions
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
- Removed: `xxx2xxx()` and `xxx2xxxRaw()` functions
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
- Removed: `convert()` class
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
- Changed: all functions to lookup dictionary
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
- Changed: `ansi` to `ansi256`
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
- Fixed: argument grouping for functions requiring only one argument
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
|
||||
# 0.6.0 - 2015-07-23
|
||||
|
||||
- Added: methods to handle
|
||||
[ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) 16/256 colors:
|
||||
- rgb2ansi16
|
||||
- rgb2ansi
|
||||
- hsl2ansi16
|
||||
- hsl2ansi
|
||||
- hsv2ansi16
|
||||
- hsv2ansi
|
||||
- hwb2ansi16
|
||||
- hwb2ansi
|
||||
- cmyk2ansi16
|
||||
- cmyk2ansi
|
||||
- keyword2ansi16
|
||||
- keyword2ansi
|
||||
- ansi162rgb
|
||||
- ansi162hsl
|
||||
- ansi162hsv
|
||||
- ansi162hwb
|
||||
- ansi162cmyk
|
||||
- ansi162keyword
|
||||
- ansi2rgb
|
||||
- ansi2hsl
|
||||
- ansi2hsv
|
||||
- ansi2hwb
|
||||
- ansi2cmyk
|
||||
- ansi2keyword
|
||||
([#18](https://github.com/harthur/color-convert/pull/18))
|
||||
|
||||
# 0.5.3 - 2015-06-02
|
||||
|
||||
- Fixed: hsl2hsv does not return `NaN` anymore when using `[0,0,0]`
|
||||
([#15](https://github.com/harthur/color-convert/issues/15))
|
||||
|
||||
---
|
||||
|
||||
Check out commit logs for older releases
|
21
node_modules/nyc/node_modules/color-convert/LICENSE
generated
vendored
Normal file
21
node_modules/nyc/node_modules/color-convert/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.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
node_modules/nyc/node_modules/color-convert/README.md
generated
vendored
Normal file
68
node_modules/nyc/node_modules/color-convert/README.md
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
# color-convert
|
||||
|
||||
[](https://travis-ci.org/Qix-/color-convert)
|
||||
|
||||
Color-convert is a color conversion library for JavaScript and node.
|
||||
It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest):
|
||||
|
||||
```js
|
||||
var convert = require('color-convert');
|
||||
|
||||
convert.rgb.hsl(140, 200, 100); // [96, 48, 59]
|
||||
convert.keyword.rgb('blue'); // [0, 0, 255]
|
||||
|
||||
var rgbChannels = convert.rgb.channels; // 3
|
||||
var cmykChannels = convert.cmyk.channels; // 4
|
||||
var ansiChannels = convert.ansi16.channels; // 1
|
||||
```
|
||||
|
||||
# Install
|
||||
|
||||
```console
|
||||
$ npm install color-convert
|
||||
```
|
||||
|
||||
# API
|
||||
|
||||
Simply get the property of the _from_ and _to_ conversion that you're looking for.
|
||||
|
||||
All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function.
|
||||
|
||||
All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha).
|
||||
|
||||
```js
|
||||
var convert = require('color-convert');
|
||||
|
||||
// Hex to LAB
|
||||
convert.hex.lab('DEADBF'); // [ 76, 21, -2 ]
|
||||
convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ]
|
||||
|
||||
// RGB to CMYK
|
||||
convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ]
|
||||
convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ]
|
||||
```
|
||||
|
||||
### Arrays
|
||||
All functions that accept multiple arguments also support passing an array.
|
||||
|
||||
Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.)
|
||||
|
||||
```js
|
||||
var convert = require('color-convert');
|
||||
|
||||
convert.rgb.hex(123, 45, 67); // '7B2D43'
|
||||
convert.rgb.hex([123, 45, 67]); // '7B2D43'
|
||||
```
|
||||
|
||||
## Routing
|
||||
|
||||
Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex).
|
||||
|
||||
Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js).
|
||||
|
||||
# Contribute
|
||||
|
||||
If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request.
|
||||
|
||||
# License
|
||||
Copyright © 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE).
|
839
node_modules/nyc/node_modules/color-convert/conversions.js
generated
vendored
Normal file
839
node_modules/nyc/node_modules/color-convert/conversions.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
81
node_modules/nyc/node_modules/color-convert/index.js
generated
vendored
Normal file
81
node_modules/nyc/node_modules/color-convert/index.js
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
const conversions = require('./conversions');
|
||||
const route = require('./route');
|
||||
|
||||
const convert = {};
|
||||
|
||||
const models = Object.keys(conversions);
|
||||
|
||||
function wrapRaw(fn) {
|
||||
const wrappedFn = function (...args) {
|
||||
const arg0 = args[0];
|
||||
if (arg0 === undefined || arg0 === null) {
|
||||
return arg0;
|
||||
}
|
||||
|
||||
if (arg0.length > 1) {
|
||||
args = arg0;
|
||||
}
|
||||
|
||||
return fn(args);
|
||||
};
|
||||
|
||||
// Preserve .conversion property if there is one
|
||||
if ('conversion' in fn) {
|
||||
wrappedFn.conversion = fn.conversion;
|
||||
}
|
||||
|
||||
return wrappedFn;
|
||||
}
|
||||
|
||||
function wrapRounded(fn) {
|
||||
const wrappedFn = function (...args) {
|
||||
const arg0 = args[0];
|
||||
|
||||
if (arg0 === undefined || arg0 === null) {
|
||||
return arg0;
|
||||
}
|
||||
|
||||
if (arg0.length > 1) {
|
||||
args = arg0;
|
||||
}
|
||||
|
||||
const result = fn(args);
|
||||
|
||||
// We're assuming the result is an array here.
|
||||
// see notice in conversions.js; don't use box types
|
||||
// in conversion functions.
|
||||
if (typeof result === 'object') {
|
||||
for (let len = result.length, i = 0; i < len; i++) {
|
||||
result[i] = Math.round(result[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
// Preserve .conversion property if there is one
|
||||
if ('conversion' in fn) {
|
||||
wrappedFn.conversion = fn.conversion;
|
||||
}
|
||||
|
||||
return wrappedFn;
|
||||
}
|
||||
|
||||
models.forEach(fromModel => {
|
||||
convert[fromModel] = {};
|
||||
|
||||
Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
|
||||
Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
|
||||
|
||||
const routes = route(fromModel);
|
||||
const routeModels = Object.keys(routes);
|
||||
|
||||
routeModels.forEach(toModel => {
|
||||
const fn = routes[toModel];
|
||||
|
||||
convert[fromModel][toModel] = wrapRounded(fn);
|
||||
convert[fromModel][toModel].raw = wrapRaw(fn);
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = convert;
|
48
node_modules/nyc/node_modules/color-convert/package.json
generated
vendored
Normal file
48
node_modules/nyc/node_modules/color-convert/package.json
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "color-convert",
|
||||
"description": "Plain color conversion functions",
|
||||
"version": "2.0.1",
|
||||
"author": "Heather Arthur <fayearthur@gmail.com>",
|
||||
"license": "MIT",
|
||||
"repository": "Qix-/color-convert",
|
||||
"scripts": {
|
||||
"pretest": "xo",
|
||||
"test": "node test/basic.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=7.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"color",
|
||||
"colour",
|
||||
"convert",
|
||||
"converter",
|
||||
"conversion",
|
||||
"rgb",
|
||||
"hsl",
|
||||
"hsv",
|
||||
"hwb",
|
||||
"cmyk",
|
||||
"ansi",
|
||||
"ansi16"
|
||||
],
|
||||
"files": [
|
||||
"index.js",
|
||||
"conversions.js",
|
||||
"route.js"
|
||||
],
|
||||
"xo": {
|
||||
"rules": {
|
||||
"default-case": 0,
|
||||
"no-inline-comments": 0,
|
||||
"operator-linebreak": 0
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"chalk": "^2.4.2",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"color-name": "~1.1.4"
|
||||
}
|
||||
}
|
97
node_modules/nyc/node_modules/color-convert/route.js
generated
vendored
Normal file
97
node_modules/nyc/node_modules/color-convert/route.js
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
const conversions = require('./conversions');
|
||||
|
||||
/*
|
||||
This function routes a model to all other models.
|
||||
|
||||
all functions that are routed have a property `.conversion` attached
|
||||
to the returned synthetic function. This property is an array
|
||||
of strings, each with the steps in between the 'from' and 'to'
|
||||
color models (inclusive).
|
||||
|
||||
conversions that are not possible simply are not included.
|
||||
*/
|
||||
|
||||
function buildGraph() {
|
||||
const graph = {};
|
||||
// https://jsperf.com/object-keys-vs-for-in-with-closure/3
|
||||
const models = Object.keys(conversions);
|
||||
|
||||
for (let len = models.length, i = 0; i < len; i++) {
|
||||
graph[models[i]] = {
|
||||
// http://jsperf.com/1-vs-infinity
|
||||
// micro-opt, but this is simple.
|
||||
distance: -1,
|
||||
parent: null
|
||||
};
|
||||
}
|
||||
|
||||
return graph;
|
||||
}
|
||||
|
||||
// https://en.wikipedia.org/wiki/Breadth-first_search
|
||||
function deriveBFS(fromModel) {
|
||||
const graph = buildGraph();
|
||||
const queue = [fromModel]; // Unshift -> queue -> pop
|
||||
|
||||
graph[fromModel].distance = 0;
|
||||
|
||||
while (queue.length) {
|
||||
const current = queue.pop();
|
||||
const adjacents = Object.keys(conversions[current]);
|
||||
|
||||
for (let len = adjacents.length, i = 0; i < len; i++) {
|
||||
const adjacent = adjacents[i];
|
||||
const node = graph[adjacent];
|
||||
|
||||
if (node.distance === -1) {
|
||||
node.distance = graph[current].distance + 1;
|
||||
node.parent = current;
|
||||
queue.unshift(adjacent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return graph;
|
||||
}
|
||||
|
||||
function link(from, to) {
|
||||
return function (args) {
|
||||
return to(from(args));
|
||||
};
|
||||
}
|
||||
|
||||
function wrapConversion(toModel, graph) {
|
||||
const path = [graph[toModel].parent, toModel];
|
||||
let fn = conversions[graph[toModel].parent][toModel];
|
||||
|
||||
let cur = graph[toModel].parent;
|
||||
while (graph[cur].parent) {
|
||||
path.unshift(graph[cur].parent);
|
||||
fn = link(conversions[graph[cur].parent][cur], fn);
|
||||
cur = graph[cur].parent;
|
||||
}
|
||||
|
||||
fn.conversion = path;
|
||||
return fn;
|
||||
}
|
||||
|
||||
module.exports = function (fromModel) {
|
||||
const graph = deriveBFS(fromModel);
|
||||
const conversion = {};
|
||||
|
||||
const models = Object.keys(graph);
|
||||
for (let len = models.length, i = 0; i < len; i++) {
|
||||
const toModel = models[i];
|
||||
const node = graph[toModel];
|
||||
|
||||
if (node.parent === null) {
|
||||
// No possible conversion, or this node is the source model.
|
||||
continue;
|
||||
}
|
||||
|
||||
conversion[toModel] = wrapConversion(toModel, graph);
|
||||
}
|
||||
|
||||
return conversion;
|
||||
};
|
||||
|
8
node_modules/nyc/node_modules/color-name/LICENSE
generated
vendored
Normal file
8
node_modules/nyc/node_modules/color-name/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
The MIT License (MIT)
|
||||
Copyright (c) 2015 Dmitry Ivanov
|
||||
|
||||
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.
|
11
node_modules/nyc/node_modules/color-name/README.md
generated
vendored
Normal file
11
node_modules/nyc/node_modules/color-name/README.md
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors.
|
||||
|
||||
[](https://nodei.co/npm/color-name/)
|
||||
|
||||
|
||||
```js
|
||||
var colors = require('color-name');
|
||||
colors.red //[255,0,0]
|
||||
```
|
||||
|
||||
<a href="LICENSE"><img src="https://upload.wikimedia.org/wikipedia/commons/0/0c/MIT_logo.svg" width="120"/></a>
|
152
node_modules/nyc/node_modules/color-name/index.js
generated
vendored
Normal file
152
node_modules/nyc/node_modules/color-name/index.js
generated
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = {
|
||||
"aliceblue": [240, 248, 255],
|
||||
"antiquewhite": [250, 235, 215],
|
||||
"aqua": [0, 255, 255],
|
||||
"aquamarine": [127, 255, 212],
|
||||
"azure": [240, 255, 255],
|
||||
"beige": [245, 245, 220],
|
||||
"bisque": [255, 228, 196],
|
||||
"black": [0, 0, 0],
|
||||
"blanchedalmond": [255, 235, 205],
|
||||
"blue": [0, 0, 255],
|
||||
"blueviolet": [138, 43, 226],
|
||||
"brown": [165, 42, 42],
|
||||
"burlywood": [222, 184, 135],
|
||||
"cadetblue": [95, 158, 160],
|
||||
"chartreuse": [127, 255, 0],
|
||||
"chocolate": [210, 105, 30],
|
||||
"coral": [255, 127, 80],
|
||||
"cornflowerblue": [100, 149, 237],
|
||||
"cornsilk": [255, 248, 220],
|
||||
"crimson": [220, 20, 60],
|
||||
"cyan": [0, 255, 255],
|
||||
"darkblue": [0, 0, 139],
|
||||
"darkcyan": [0, 139, 139],
|
||||
"darkgoldenrod": [184, 134, 11],
|
||||
"darkgray": [169, 169, 169],
|
||||
"darkgreen": [0, 100, 0],
|
||||
"darkgrey": [169, 169, 169],
|
||||
"darkkhaki": [189, 183, 107],
|
||||
"darkmagenta": [139, 0, 139],
|
||||
"darkolivegreen": [85, 107, 47],
|
||||
"darkorange": [255, 140, 0],
|
||||
"darkorchid": [153, 50, 204],
|
||||
"darkred": [139, 0, 0],
|
||||
"darksalmon": [233, 150, 122],
|
||||
"darkseagreen": [143, 188, 143],
|
||||
"darkslateblue": [72, 61, 139],
|
||||
"darkslategray": [47, 79, 79],
|
||||
"darkslategrey": [47, 79, 79],
|
||||
"darkturquoise": [0, 206, 209],
|
||||
"darkviolet": [148, 0, 211],
|
||||
"deeppink": [255, 20, 147],
|
||||
"deepskyblue": [0, 191, 255],
|
||||
"dimgray": [105, 105, 105],
|
||||
"dimgrey": [105, 105, 105],
|
||||
"dodgerblue": [30, 144, 255],
|
||||
"firebrick": [178, 34, 34],
|
||||
"floralwhite": [255, 250, 240],
|
||||
"forestgreen": [34, 139, 34],
|
||||
"fuchsia": [255, 0, 255],
|
||||
"gainsboro": [220, 220, 220],
|
||||
"ghostwhite": [248, 248, 255],
|
||||
"gold": [255, 215, 0],
|
||||
"goldenrod": [218, 165, 32],
|
||||
"gray": [128, 128, 128],
|
||||
"green": [0, 128, 0],
|
||||
"greenyellow": [173, 255, 47],
|
||||
"grey": [128, 128, 128],
|
||||
"honeydew": [240, 255, 240],
|
||||
"hotpink": [255, 105, 180],
|
||||
"indianred": [205, 92, 92],
|
||||
"indigo": [75, 0, 130],
|
||||
"ivory": [255, 255, 240],
|
||||
"khaki": [240, 230, 140],
|
||||
"lavender": [230, 230, 250],
|
||||
"lavenderblush": [255, 240, 245],
|
||||
"lawngreen": [124, 252, 0],
|
||||
"lemonchiffon": [255, 250, 205],
|
||||
"lightblue": [173, 216, 230],
|
||||
"lightcoral": [240, 128, 128],
|
||||
"lightcyan": [224, 255, 255],
|
||||
"lightgoldenrodyellow": [250, 250, 210],
|
||||
"lightgray": [211, 211, 211],
|
||||
"lightgreen": [144, 238, 144],
|
||||
"lightgrey": [211, 211, 211],
|
||||
"lightpink": [255, 182, 193],
|
||||
"lightsalmon": [255, 160, 122],
|
||||
"lightseagreen": [32, 178, 170],
|
||||
"lightskyblue": [135, 206, 250],
|
||||
"lightslategray": [119, 136, 153],
|
||||
"lightslategrey": [119, 136, 153],
|
||||
"lightsteelblue": [176, 196, 222],
|
||||
"lightyellow": [255, 255, 224],
|
||||
"lime": [0, 255, 0],
|
||||
"limegreen": [50, 205, 50],
|
||||
"linen": [250, 240, 230],
|
||||
"magenta": [255, 0, 255],
|
||||
"maroon": [128, 0, 0],
|
||||
"mediumaquamarine": [102, 205, 170],
|
||||
"mediumblue": [0, 0, 205],
|
||||
"mediumorchid": [186, 85, 211],
|
||||
"mediumpurple": [147, 112, 219],
|
||||
"mediumseagreen": [60, 179, 113],
|
||||
"mediumslateblue": [123, 104, 238],
|
||||
"mediumspringgreen": [0, 250, 154],
|
||||
"mediumturquoise": [72, 209, 204],
|
||||
"mediumvioletred": [199, 21, 133],
|
||||
"midnightblue": [25, 25, 112],
|
||||
"mintcream": [245, 255, 250],
|
||||
"mistyrose": [255, 228, 225],
|
||||
"moccasin": [255, 228, 181],
|
||||
"navajowhite": [255, 222, 173],
|
||||
"navy": [0, 0, 128],
|
||||
"oldlace": [253, 245, 230],
|
||||
"olive": [128, 128, 0],
|
||||
"olivedrab": [107, 142, 35],
|
||||
"orange": [255, 165, 0],
|
||||
"orangered": [255, 69, 0],
|
||||
"orchid": [218, 112, 214],
|
||||
"palegoldenrod": [238, 232, 170],
|
||||
"palegreen": [152, 251, 152],
|
||||
"paleturquoise": [175, 238, 238],
|
||||
"palevioletred": [219, 112, 147],
|
||||
"papayawhip": [255, 239, 213],
|
||||
"peachpuff": [255, 218, 185],
|
||||
"peru": [205, 133, 63],
|
||||
"pink": [255, 192, 203],
|
||||
"plum": [221, 160, 221],
|
||||
"powderblue": [176, 224, 230],
|
||||
"purple": [128, 0, 128],
|
||||
"rebeccapurple": [102, 51, 153],
|
||||
"red": [255, 0, 0],
|
||||
"rosybrown": [188, 143, 143],
|
||||
"royalblue": [65, 105, 225],
|
||||
"saddlebrown": [139, 69, 19],
|
||||
"salmon": [250, 128, 114],
|
||||
"sandybrown": [244, 164, 96],
|
||||
"seagreen": [46, 139, 87],
|
||||
"seashell": [255, 245, 238],
|
||||
"sienna": [160, 82, 45],
|
||||
"silver": [192, 192, 192],
|
||||
"skyblue": [135, 206, 235],
|
||||
"slateblue": [106, 90, 205],
|
||||
"slategray": [112, 128, 144],
|
||||
"slategrey": [112, 128, 144],
|
||||
"snow": [255, 250, 250],
|
||||
"springgreen": [0, 255, 127],
|
||||
"steelblue": [70, 130, 180],
|
||||
"tan": [210, 180, 140],
|
||||
"teal": [0, 128, 128],
|
||||
"thistle": [216, 191, 216],
|
||||
"tomato": [255, 99, 71],
|
||||
"turquoise": [64, 224, 208],
|
||||
"violet": [238, 130, 238],
|
||||
"wheat": [245, 222, 179],
|
||||
"white": [255, 255, 255],
|
||||
"whitesmoke": [245, 245, 245],
|
||||
"yellow": [255, 255, 0],
|
||||
"yellowgreen": [154, 205, 50]
|
||||
};
|
28
node_modules/nyc/node_modules/color-name/package.json
generated
vendored
Normal file
28
node_modules/nyc/node_modules/color-name/package.json
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "color-name",
|
||||
"version": "1.1.4",
|
||||
"description": "A list of color names and its values",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:colorjs/color-name.git"
|
||||
},
|
||||
"keywords": [
|
||||
"color-name",
|
||||
"color",
|
||||
"color-keyword",
|
||||
"keyword"
|
||||
],
|
||||
"author": "DY <dfcreative@gmail.com>",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/colorjs/color-name/issues"
|
||||
},
|
||||
"homepage": "https://github.com/colorjs/color-name"
|
||||
}
|
67
node_modules/nyc/node_modules/find-cache-dir/index.js
generated
vendored
Normal file
67
node_modules/nyc/node_modules/find-cache-dir/index.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const commonDir = require('commondir');
|
||||
const pkgDir = require('pkg-dir');
|
||||
const makeDir = require('make-dir');
|
||||
|
||||
const {env, cwd} = process;
|
||||
|
||||
const isWritable = path => {
|
||||
try {
|
||||
fs.accessSync(path, fs.constants.W_OK);
|
||||
return true;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
function useDirectory(directory, options) {
|
||||
if (options.create) {
|
||||
makeDir.sync(directory);
|
||||
}
|
||||
|
||||
if (options.thunk) {
|
||||
return (...arguments_) => path.join(directory, ...arguments_);
|
||||
}
|
||||
|
||||
return directory;
|
||||
}
|
||||
|
||||
function getNodeModuleDirectory(directory) {
|
||||
const nodeModules = path.join(directory, 'node_modules');
|
||||
|
||||
if (
|
||||
!isWritable(nodeModules) &&
|
||||
(fs.existsSync(nodeModules) || !isWritable(path.join(directory)))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
return nodeModules;
|
||||
}
|
||||
|
||||
module.exports = (options = {}) => {
|
||||
if (env.CACHE_DIR && !['true', 'false', '1', '0'].includes(env.CACHE_DIR)) {
|
||||
return useDirectory(path.join(env.CACHE_DIR, 'find-cache-dir'), options);
|
||||
}
|
||||
|
||||
let {cwd: directory = cwd()} = options;
|
||||
|
||||
if (options.files) {
|
||||
directory = commonDir(directory, options.files);
|
||||
}
|
||||
|
||||
directory = pkgDir.sync(directory);
|
||||
|
||||
if (!directory) {
|
||||
return;
|
||||
}
|
||||
|
||||
const nodeModules = getNodeModuleDirectory(directory);
|
||||
if (!nodeModules) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return useDirectory(path.join(directory, 'node_modules', '.cache', options.name), options);
|
||||
};
|
9
node_modules/nyc/node_modules/find-cache-dir/license
generated
vendored
Normal file
9
node_modules/nyc/node_modules/find-cache-dir/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://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.
|
44
node_modules/nyc/node_modules/find-cache-dir/package.json
generated
vendored
Normal file
44
node_modules/nyc/node_modules/find-cache-dir/package.json
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "find-cache-dir",
|
||||
"version": "3.3.1",
|
||||
"description": "Finds the common standard cache directory",
|
||||
"license": "MIT",
|
||||
"repository": "avajs/find-cache-dir",
|
||||
"funding": "https://github.com/avajs/find-cache-dir?sponsor=1",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && nyc ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"cache",
|
||||
"directory",
|
||||
"dir",
|
||||
"caching",
|
||||
"find",
|
||||
"search"
|
||||
],
|
||||
"dependencies": {
|
||||
"commondir": "^1.0.1",
|
||||
"make-dir": "^3.0.2",
|
||||
"pkg-dir": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^2.4.0",
|
||||
"coveralls": "^3.0.9",
|
||||
"del": "^4.0.0",
|
||||
"nyc": "^15.0.0",
|
||||
"tempy": "^0.4.0",
|
||||
"xo": "^0.25.3"
|
||||
},
|
||||
"nyc": {
|
||||
"reporter": [
|
||||
"lcov",
|
||||
"text"
|
||||
]
|
||||
}
|
||||
}
|
124
node_modules/nyc/node_modules/find-cache-dir/readme.md
generated
vendored
Normal file
124
node_modules/nyc/node_modules/find-cache-dir/readme.md
generated
vendored
Normal file
@@ -0,0 +1,124 @@
|
||||
# find-cache-dir [](https://travis-ci.org/avajs/find-cache-dir) [](https://coveralls.io/github/avajs/find-cache-dir?branch=master)
|
||||
|
||||
> Finds the common standard cache directory
|
||||
|
||||
The [`nyc`](https://github.com/istanbuljs/nyc) and [`AVA`](https://ava.li) projects decided to standardize on a common directory structure for storing cache information:
|
||||
|
||||
```sh
|
||||
# nyc
|
||||
./node_modules/.cache/nyc
|
||||
|
||||
# ava
|
||||
./node_modules/.cache/ava
|
||||
|
||||
# your-module
|
||||
./node_modules/.cache/your-module
|
||||
```
|
||||
|
||||
This module makes it easy to correctly locate the cache directory according to this shared spec. If this pattern becomes ubiquitous, clearing the cache for multiple dependencies becomes easy and consistent:
|
||||
|
||||
```
|
||||
rm -rf ./node_modules/.cache
|
||||
```
|
||||
|
||||
If you decide to adopt this pattern, please file a PR adding your name to the list of adopters below.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install find-cache-dir
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const findCacheDir = require('find-cache-dir');
|
||||
|
||||
findCacheDir({name: 'unicorns'});
|
||||
//=> '/user/path/node-modules/.cache/unicorns'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### findCacheDir(options?)
|
||||
|
||||
Finds the cache directory using the supplied options. The algorithm checks for the `CACHE_DIR` environmental variable and uses it if it is not set to `true`, `false`, `1` or `0`. If one is not found, it tries to find a `package.json` file, searching every parent directory of the `cwd` specified (or implied from other options). It returns a `string` containing the absolute path to the cache directory, or `undefined` if `package.json` was never found or if the `node_modules` directory is unwritable.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### name
|
||||
|
||||
*Required*\
|
||||
Type: `string`
|
||||
|
||||
Should be the same as your project name in `package.json`.
|
||||
|
||||
##### files
|
||||
|
||||
Type: `string[] | string`
|
||||
|
||||
An array of files that will be searched for a common parent directory. This common parent directory will be used in lieu of the `cwd` option below.
|
||||
|
||||
##### cwd
|
||||
|
||||
Type: `string`\
|
||||
Default `process.cwd()`
|
||||
|
||||
Directory to start searching for a `package.json` from.
|
||||
|
||||
##### create
|
||||
|
||||
Type: `boolean`\
|
||||
Default `false`
|
||||
|
||||
If `true`, the directory will be created synchronously before returning.
|
||||
|
||||
##### thunk
|
||||
|
||||
Type: `boolean`\
|
||||
Default `false`
|
||||
|
||||
If `true`, this modifies the return type to be a function that is a thunk for `path.join(theFoundCacheDirectory)`.
|
||||
|
||||
```js
|
||||
const thunk = findCacheDir({name: 'foo', thunk: true});
|
||||
|
||||
thunk();
|
||||
//=> '/some/path/node_modules/.cache/foo'
|
||||
|
||||
thunk('bar.js')
|
||||
//=> '/some/path/node_modules/.cache/foo/bar.js'
|
||||
|
||||
thunk('baz', 'quz.js')
|
||||
//=> '/some/path/node_modules/.cache/foo/baz/quz.js'
|
||||
```
|
||||
|
||||
This is helpful for actually putting actual files in the cache!
|
||||
|
||||
## Tips
|
||||
|
||||
- To test modules using `find-cache-dir`, set the `CACHE_DIR` environment variable to temporarily override the directory that is resolved.
|
||||
|
||||
## Adopters
|
||||
|
||||
- [`AVA`](https://ava.li)
|
||||
- [`nyc`](https://github.com/istanbuljs/nyc)
|
||||
- [`Storybook`](https://storybook.js.org)
|
||||
- [`babel-loader`](https://github.com/babel/babel-loader)
|
||||
- [`eslint-loader`](https://github.com/MoOx/eslint-loader)
|
||||
- [`Phenomic`](https://phenomic.io)
|
||||
- [`javascripthon-loader`](https://github.com/Beg-in/javascripthon-loader)
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-find_cache-dir?utm_source=npm-find-cache-dir&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
17
node_modules/nyc/node_modules/is-fullwidth-code-point/index.d.ts
generated
vendored
Normal file
17
node_modules/nyc/node_modules/is-fullwidth-code-point/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms).
|
||||
|
||||
@param codePoint - The [code point](https://en.wikipedia.org/wiki/Code_point) of a character.
|
||||
|
||||
@example
|
||||
```
|
||||
import isFullwidthCodePoint from 'is-fullwidth-code-point';
|
||||
|
||||
isFullwidthCodePoint('谢'.codePointAt(0));
|
||||
//=> true
|
||||
|
||||
isFullwidthCodePoint('a'.codePointAt(0));
|
||||
//=> false
|
||||
```
|
||||
*/
|
||||
export default function isFullwidthCodePoint(codePoint: number): boolean;
|
50
node_modules/nyc/node_modules/is-fullwidth-code-point/index.js
generated
vendored
Normal file
50
node_modules/nyc/node_modules/is-fullwidth-code-point/index.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
/* eslint-disable yoda */
|
||||
'use strict';
|
||||
|
||||
const isFullwidthCodePoint = codePoint => {
|
||||
if (Number.isNaN(codePoint)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Code points are derived from:
|
||||
// http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
|
||||
if (
|
||||
codePoint >= 0x1100 && (
|
||||
codePoint <= 0x115F || // Hangul Jamo
|
||||
codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET
|
||||
codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET
|
||||
// CJK Radicals Supplement .. Enclosed CJK Letters and Months
|
||||
(0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) ||
|
||||
// Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
|
||||
(0x3250 <= codePoint && codePoint <= 0x4DBF) ||
|
||||
// CJK Unified Ideographs .. Yi Radicals
|
||||
(0x4E00 <= codePoint && codePoint <= 0xA4C6) ||
|
||||
// Hangul Jamo Extended-A
|
||||
(0xA960 <= codePoint && codePoint <= 0xA97C) ||
|
||||
// Hangul Syllables
|
||||
(0xAC00 <= codePoint && codePoint <= 0xD7A3) ||
|
||||
// CJK Compatibility Ideographs
|
||||
(0xF900 <= codePoint && codePoint <= 0xFAFF) ||
|
||||
// Vertical Forms
|
||||
(0xFE10 <= codePoint && codePoint <= 0xFE19) ||
|
||||
// CJK Compatibility Forms .. Small Form Variants
|
||||
(0xFE30 <= codePoint && codePoint <= 0xFE6B) ||
|
||||
// Halfwidth and Fullwidth Forms
|
||||
(0xFF01 <= codePoint && codePoint <= 0xFF60) ||
|
||||
(0xFFE0 <= codePoint && codePoint <= 0xFFE6) ||
|
||||
// Kana Supplement
|
||||
(0x1B000 <= codePoint && codePoint <= 0x1B001) ||
|
||||
// Enclosed Ideographic Supplement
|
||||
(0x1F200 <= codePoint && codePoint <= 0x1F251) ||
|
||||
// CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
|
||||
(0x20000 <= codePoint && codePoint <= 0x3FFFD)
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
module.exports = isFullwidthCodePoint;
|
||||
module.exports.default = isFullwidthCodePoint;
|
9
node_modules/nyc/node_modules/is-fullwidth-code-point/license
generated
vendored
Normal file
9
node_modules/nyc/node_modules/is-fullwidth-code-point/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.
|
42
node_modules/nyc/node_modules/is-fullwidth-code-point/package.json
generated
vendored
Normal file
42
node_modules/nyc/node_modules/is-fullwidth-code-point/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "is-fullwidth-code-point",
|
||||
"version": "3.0.0",
|
||||
"description": "Check if the character represented by a given Unicode code point is fullwidth",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/is-fullwidth-code-point",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd-check"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"fullwidth",
|
||||
"full-width",
|
||||
"full",
|
||||
"width",
|
||||
"unicode",
|
||||
"character",
|
||||
"string",
|
||||
"codepoint",
|
||||
"code",
|
||||
"point",
|
||||
"is",
|
||||
"detect",
|
||||
"check"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^1.3.1",
|
||||
"tsd-check": "^0.5.0",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
39
node_modules/nyc/node_modules/is-fullwidth-code-point/readme.md
generated
vendored
Normal file
39
node_modules/nyc/node_modules/is-fullwidth-code-point/readme.md
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
# is-fullwidth-code-point [](https://travis-ci.org/sindresorhus/is-fullwidth-code-point)
|
||||
|
||||
> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install is-fullwidth-code-point
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const isFullwidthCodePoint = require('is-fullwidth-code-point');
|
||||
|
||||
isFullwidthCodePoint('谢'.codePointAt(0));
|
||||
//=> true
|
||||
|
||||
isFullwidthCodePoint('a'.codePointAt(0));
|
||||
//=> false
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### isFullwidthCodePoint(codePoint)
|
||||
|
||||
#### codePoint
|
||||
|
||||
Type: `number`
|
||||
|
||||
The [code point](https://en.wikipedia.org/wiki/Code_point) of a character.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
66
node_modules/nyc/node_modules/make-dir/index.d.ts
generated
vendored
Normal file
66
node_modules/nyc/node_modules/make-dir/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
/// <reference types="node"/>
|
||||
import * as fs from 'fs';
|
||||
|
||||
declare namespace makeDir {
|
||||
interface Options {
|
||||
/**
|
||||
Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/).
|
||||
|
||||
@default 0o777
|
||||
*/
|
||||
readonly mode?: number;
|
||||
|
||||
/**
|
||||
Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).
|
||||
|
||||
Using a custom `fs` implementation will block the use of the native `recursive` option if `fs.mkdir` or `fs.mkdirSync` is not the native function.
|
||||
|
||||
@default require('fs')
|
||||
*/
|
||||
readonly fs?: typeof fs;
|
||||
}
|
||||
}
|
||||
|
||||
declare const makeDir: {
|
||||
/**
|
||||
Make a directory and its parents if needed - Think `mkdir -p`.
|
||||
|
||||
@param path - Directory to create.
|
||||
@returns The path to the created directory.
|
||||
|
||||
@example
|
||||
```
|
||||
import makeDir = require('make-dir');
|
||||
|
||||
(async () => {
|
||||
const path = await makeDir('unicorn/rainbow/cake');
|
||||
|
||||
console.log(path);
|
||||
//=> '/Users/sindresorhus/fun/unicorn/rainbow/cake'
|
||||
|
||||
// Multiple directories:
|
||||
const paths = await Promise.all([
|
||||
makeDir('unicorn/rainbow'),
|
||||
makeDir('foo/bar')
|
||||
]);
|
||||
|
||||
console.log(paths);
|
||||
// [
|
||||
// '/Users/sindresorhus/fun/unicorn/rainbow',
|
||||
// '/Users/sindresorhus/fun/foo/bar'
|
||||
// ]
|
||||
})();
|
||||
```
|
||||
*/
|
||||
(path: string, options?: makeDir.Options): Promise<string>;
|
||||
|
||||
/**
|
||||
Synchronously make a directory and its parents if needed - Think `mkdir -p`.
|
||||
|
||||
@param path - Directory to create.
|
||||
@returns The path to the created directory.
|
||||
*/
|
||||
sync(path: string, options?: makeDir.Options): string;
|
||||
};
|
||||
|
||||
export = makeDir;
|
156
node_modules/nyc/node_modules/make-dir/index.js
generated
vendored
Normal file
156
node_modules/nyc/node_modules/make-dir/index.js
generated
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
'use strict';
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const {promisify} = require('util');
|
||||
const semver = require('semver');
|
||||
|
||||
const useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0');
|
||||
|
||||
// https://github.com/nodejs/node/issues/8987
|
||||
// https://github.com/libuv/libuv/pull/1088
|
||||
const checkPath = pth => {
|
||||
if (process.platform === 'win32') {
|
||||
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ''));
|
||||
|
||||
if (pathHasInvalidWinCharacters) {
|
||||
const error = new Error(`Path contains invalid characters: ${pth}`);
|
||||
error.code = 'EINVAL';
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const processOptions = options => {
|
||||
// https://github.com/sindresorhus/make-dir/issues/18
|
||||
const defaults = {
|
||||
mode: 0o777,
|
||||
fs
|
||||
};
|
||||
|
||||
return {
|
||||
...defaults,
|
||||
...options
|
||||
};
|
||||
};
|
||||
|
||||
const permissionError = pth => {
|
||||
// This replicates the exception of `fs.mkdir` with native the
|
||||
// `recusive` option when run on an invalid drive under Windows.
|
||||
const error = new Error(`operation not permitted, mkdir '${pth}'`);
|
||||
error.code = 'EPERM';
|
||||
error.errno = -4048;
|
||||
error.path = pth;
|
||||
error.syscall = 'mkdir';
|
||||
return error;
|
||||
};
|
||||
|
||||
const makeDir = async (input, options) => {
|
||||
checkPath(input);
|
||||
options = processOptions(options);
|
||||
|
||||
const mkdir = promisify(options.fs.mkdir);
|
||||
const stat = promisify(options.fs.stat);
|
||||
|
||||
if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) {
|
||||
const pth = path.resolve(input);
|
||||
|
||||
await mkdir(pth, {
|
||||
mode: options.mode,
|
||||
recursive: true
|
||||
});
|
||||
|
||||
return pth;
|
||||
}
|
||||
|
||||
const make = async pth => {
|
||||
try {
|
||||
await mkdir(pth, options.mode);
|
||||
|
||||
return pth;
|
||||
} catch (error) {
|
||||
if (error.code === 'EPERM') {
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (error.code === 'ENOENT') {
|
||||
if (path.dirname(pth) === pth) {
|
||||
throw permissionError(pth);
|
||||
}
|
||||
|
||||
if (error.message.includes('null bytes')) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
await make(path.dirname(pth));
|
||||
|
||||
return make(pth);
|
||||
}
|
||||
|
||||
try {
|
||||
const stats = await stat(pth);
|
||||
if (!stats.isDirectory()) {
|
||||
throw new Error('The path is not a directory');
|
||||
}
|
||||
} catch (_) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return pth;
|
||||
}
|
||||
};
|
||||
|
||||
return make(path.resolve(input));
|
||||
};
|
||||
|
||||
module.exports = makeDir;
|
||||
|
||||
module.exports.sync = (input, options) => {
|
||||
checkPath(input);
|
||||
options = processOptions(options);
|
||||
|
||||
if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) {
|
||||
const pth = path.resolve(input);
|
||||
|
||||
fs.mkdirSync(pth, {
|
||||
mode: options.mode,
|
||||
recursive: true
|
||||
});
|
||||
|
||||
return pth;
|
||||
}
|
||||
|
||||
const make = pth => {
|
||||
try {
|
||||
options.fs.mkdirSync(pth, options.mode);
|
||||
} catch (error) {
|
||||
if (error.code === 'EPERM') {
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (error.code === 'ENOENT') {
|
||||
if (path.dirname(pth) === pth) {
|
||||
throw permissionError(pth);
|
||||
}
|
||||
|
||||
if (error.message.includes('null bytes')) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
make(path.dirname(pth));
|
||||
return make(pth);
|
||||
}
|
||||
|
||||
try {
|
||||
if (!options.fs.statSync(pth).isDirectory()) {
|
||||
throw new Error('The path is not a directory');
|
||||
}
|
||||
} catch (_) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
return pth;
|
||||
};
|
||||
|
||||
return make(path.resolve(input));
|
||||
};
|
9
node_modules/nyc/node_modules/make-dir/license
generated
vendored
Normal file
9
node_modules/nyc/node_modules/make-dir/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.
|
59
node_modules/nyc/node_modules/make-dir/package.json
generated
vendored
Normal file
59
node_modules/nyc/node_modules/make-dir/package.json
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"name": "make-dir",
|
||||
"version": "3.1.0",
|
||||
"description": "Make a directory and its parents if needed - Think `mkdir -p`",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/make-dir",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && nyc ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"mkdir",
|
||||
"mkdirp",
|
||||
"make",
|
||||
"directories",
|
||||
"dir",
|
||||
"dirs",
|
||||
"folders",
|
||||
"directory",
|
||||
"folder",
|
||||
"path",
|
||||
"parent",
|
||||
"parents",
|
||||
"intermediate",
|
||||
"recursively",
|
||||
"recursive",
|
||||
"create",
|
||||
"fs",
|
||||
"filesystem",
|
||||
"file-system"
|
||||
],
|
||||
"dependencies": {
|
||||
"semver": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/graceful-fs": "^4.1.3",
|
||||
"@types/node": "^13.7.1",
|
||||
"ava": "^1.4.0",
|
||||
"codecov": "^3.2.0",
|
||||
"graceful-fs": "^4.1.15",
|
||||
"nyc": "^15.0.0",
|
||||
"path-type": "^4.0.0",
|
||||
"tempy": "^0.2.1",
|
||||
"tsd": "^0.11.0",
|
||||
"xo": "^0.25.4"
|
||||
}
|
||||
}
|
125
node_modules/nyc/node_modules/make-dir/readme.md
generated
vendored
Normal file
125
node_modules/nyc/node_modules/make-dir/readme.md
generated
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
# make-dir [](https://travis-ci.org/sindresorhus/make-dir) [](https://codecov.io/gh/sindresorhus/make-dir)
|
||||
|
||||
> Make a directory and its parents if needed - Think `mkdir -p`
|
||||
|
||||
## Advantages over [`mkdirp`](https://github.com/substack/node-mkdirp)
|
||||
|
||||
- Promise API *(Async/await ready!)*
|
||||
- Fixes many `mkdirp` issues: [#96](https://github.com/substack/node-mkdirp/pull/96) [#70](https://github.com/substack/node-mkdirp/issues/70) [#66](https://github.com/substack/node-mkdirp/issues/66)
|
||||
- 100% test coverage
|
||||
- CI-tested on macOS, Linux, and Windows
|
||||
- Actively maintained
|
||||
- Doesn't bundle a CLI
|
||||
- Uses the native `fs.mkdir/mkdirSync` [`recursive` option](https://nodejs.org/dist/latest/docs/api/fs.html#fs_fs_mkdir_path_options_callback) in Node.js >=10.12.0 unless [overridden](#fs)
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install make-dir
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
$ pwd
|
||||
/Users/sindresorhus/fun
|
||||
$ tree
|
||||
.
|
||||
```
|
||||
|
||||
```js
|
||||
const makeDir = require('make-dir');
|
||||
|
||||
(async () => {
|
||||
const path = await makeDir('unicorn/rainbow/cake');
|
||||
|
||||
console.log(path);
|
||||
//=> '/Users/sindresorhus/fun/unicorn/rainbow/cake'
|
||||
})();
|
||||
```
|
||||
|
||||
```
|
||||
$ tree
|
||||
.
|
||||
└── unicorn
|
||||
└── rainbow
|
||||
└── cake
|
||||
```
|
||||
|
||||
Multiple directories:
|
||||
|
||||
```js
|
||||
const makeDir = require('make-dir');
|
||||
|
||||
(async () => {
|
||||
const paths = await Promise.all([
|
||||
makeDir('unicorn/rainbow'),
|
||||
makeDir('foo/bar')
|
||||
]);
|
||||
|
||||
console.log(paths);
|
||||
/*
|
||||
[
|
||||
'/Users/sindresorhus/fun/unicorn/rainbow',
|
||||
'/Users/sindresorhus/fun/foo/bar'
|
||||
]
|
||||
*/
|
||||
})();
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### makeDir(path, options?)
|
||||
|
||||
Returns a `Promise` for the path to the created directory.
|
||||
|
||||
### makeDir.sync(path, options?)
|
||||
|
||||
Returns the path to the created directory.
|
||||
|
||||
#### path
|
||||
|
||||
Type: `string`
|
||||
|
||||
Directory to create.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### mode
|
||||
|
||||
Type: `integer`\
|
||||
Default: `0o777`
|
||||
|
||||
Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/).
|
||||
|
||||
##### fs
|
||||
|
||||
Type: `object`\
|
||||
Default: `require('fs')`
|
||||
|
||||
Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).
|
||||
|
||||
Using a custom `fs` implementation will block the use of the native `recursive` option if `fs.mkdir` or `fs.mkdirSync` is not the native function.
|
||||
|
||||
## Related
|
||||
|
||||
- [make-dir-cli](https://github.com/sindresorhus/make-dir-cli) - CLI for this module
|
||||
- [del](https://github.com/sindresorhus/del) - Delete files and directories
|
||||
- [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching
|
||||
- [cpy](https://github.com/sindresorhus/cpy) - Copy files
|
||||
- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - Copy files on the command-line
|
||||
- [move-file](https://github.com/sindresorhus/move-file) - Move a file
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-make-dir?utm_source=npm-make-dir&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
44
node_modules/nyc/node_modules/pkg-dir/index.d.ts
generated
vendored
Normal file
44
node_modules/nyc/node_modules/pkg-dir/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
declare const pkgDir: {
|
||||
/**
|
||||
Find the root directory of a Node.js project or npm package.
|
||||
|
||||
@param cwd - Directory to start from. Default: `process.cwd()`.
|
||||
@returns The project root path or `undefined` if it couldn't be found.
|
||||
|
||||
@example
|
||||
```
|
||||
// /
|
||||
// └── Users
|
||||
// └── sindresorhus
|
||||
// └── foo
|
||||
// ├── package.json
|
||||
// └── bar
|
||||
// ├── baz
|
||||
// └── example.js
|
||||
|
||||
// example.js
|
||||
import pkgDir = require('pkg-dir');
|
||||
|
||||
(async () => {
|
||||
const rootDir = await pkgDir(__dirname);
|
||||
|
||||
console.log(rootDir);
|
||||
//=> '/Users/sindresorhus/foo'
|
||||
})();
|
||||
```
|
||||
*/
|
||||
(cwd?: string): Promise<string | undefined>;
|
||||
|
||||
/**
|
||||
Synchronously find the root directory of a Node.js project or npm package.
|
||||
|
||||
@param cwd - Directory to start from. Default: `process.cwd()`.
|
||||
@returns The project root path or `undefined` if it couldn't be found.
|
||||
*/
|
||||
sync(cwd?: string): string | undefined;
|
||||
|
||||
// TODO: Remove this for the next major release
|
||||
default: typeof pkgDir;
|
||||
};
|
||||
|
||||
export = pkgDir;
|
17
node_modules/nyc/node_modules/pkg-dir/index.js
generated
vendored
Normal file
17
node_modules/nyc/node_modules/pkg-dir/index.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const findUp = require('find-up');
|
||||
|
||||
const pkgDir = async cwd => {
|
||||
const filePath = await findUp('package.json', {cwd});
|
||||
return filePath && path.dirname(filePath);
|
||||
};
|
||||
|
||||
module.exports = pkgDir;
|
||||
// TODO: Remove this for the next major release
|
||||
module.exports.default = pkgDir;
|
||||
|
||||
module.exports.sync = cwd => {
|
||||
const filePath = findUp.sync('package.json', {cwd});
|
||||
return filePath && path.dirname(filePath);
|
||||
};
|
9
node_modules/nyc/node_modules/pkg-dir/license
generated
vendored
Normal file
9
node_modules/nyc/node_modules/pkg-dir/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.
|
56
node_modules/nyc/node_modules/pkg-dir/package.json
generated
vendored
Normal file
56
node_modules/nyc/node_modules/pkg-dir/package.json
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "pkg-dir",
|
||||
"version": "4.2.0",
|
||||
"description": "Find the root directory of a Node.js project or npm package",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/pkg-dir",
|
||||
"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": [
|
||||
"package",
|
||||
"json",
|
||||
"root",
|
||||
"npm",
|
||||
"entry",
|
||||
"find",
|
||||
"up",
|
||||
"find-up",
|
||||
"findup",
|
||||
"look-up",
|
||||
"look",
|
||||
"file",
|
||||
"search",
|
||||
"match",
|
||||
"resolve",
|
||||
"parent",
|
||||
"parents",
|
||||
"folder",
|
||||
"directory",
|
||||
"dir",
|
||||
"walk",
|
||||
"walking",
|
||||
"path"
|
||||
],
|
||||
"dependencies": {
|
||||
"find-up": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tempy": "^0.3.0",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
66
node_modules/nyc/node_modules/pkg-dir/readme.md
generated
vendored
Normal file
66
node_modules/nyc/node_modules/pkg-dir/readme.md
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
# pkg-dir [](https://travis-ci.org/sindresorhus/pkg-dir)
|
||||
|
||||
> Find the root directory of a Node.js project or npm package
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install pkg-dir
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
/
|
||||
└── Users
|
||||
└── sindresorhus
|
||||
└── foo
|
||||
├── package.json
|
||||
└── bar
|
||||
├── baz
|
||||
└── example.js
|
||||
```
|
||||
|
||||
```js
|
||||
// example.js
|
||||
const pkgDir = require('pkg-dir');
|
||||
|
||||
(async () => {
|
||||
const rootDir = await pkgDir(__dirname);
|
||||
|
||||
console.log(rootDir);
|
||||
//=> '/Users/sindresorhus/foo'
|
||||
})();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### pkgDir([cwd])
|
||||
|
||||
Returns a `Promise` for either the project root path or `undefined` if it couldn't be found.
|
||||
|
||||
### pkgDir.sync([cwd])
|
||||
|
||||
Returns the project root path or `undefined` if it couldn't be found.
|
||||
|
||||
#### cwd
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `process.cwd()`
|
||||
|
||||
Directory to start from.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [pkg-dir-cli](https://github.com/sindresorhus/pkg-dir-cli) - CLI for this module
|
||||
- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file
|
||||
- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
31
node_modules/nyc/node_modules/resolve-from/index.d.ts
generated
vendored
Normal file
31
node_modules/nyc/node_modules/resolve-from/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
declare const resolveFrom: {
|
||||
/**
|
||||
Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path.
|
||||
|
||||
@param fromDirectory - Directory to resolve from.
|
||||
@param moduleId - What you would use in `require()`.
|
||||
@returns Resolved module path. Throws when the module can't be found.
|
||||
|
||||
@example
|
||||
```
|
||||
import resolveFrom = require('resolve-from');
|
||||
|
||||
// There is a file at `./foo/bar.js`
|
||||
|
||||
resolveFrom('foo', './bar');
|
||||
//=> '/Users/sindresorhus/dev/test/foo/bar.js'
|
||||
```
|
||||
*/
|
||||
(fromDirectory: string, moduleId: string): string;
|
||||
|
||||
/**
|
||||
Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path.
|
||||
|
||||
@param fromDirectory - Directory to resolve from.
|
||||
@param moduleId - What you would use in `require()`.
|
||||
@returns Resolved module path or `undefined` when the module can't be found.
|
||||
*/
|
||||
silent(fromDirectory: string, moduleId: string): string | undefined;
|
||||
};
|
||||
|
||||
export = resolveFrom;
|
47
node_modules/nyc/node_modules/resolve-from/index.js
generated
vendored
Normal file
47
node_modules/nyc/node_modules/resolve-from/index.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const Module = require('module');
|
||||
const fs = require('fs');
|
||||
|
||||
const resolveFrom = (fromDirectory, moduleId, silent) => {
|
||||
if (typeof fromDirectory !== 'string') {
|
||||
throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDirectory}\``);
|
||||
}
|
||||
|
||||
if (typeof moduleId !== 'string') {
|
||||
throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``);
|
||||
}
|
||||
|
||||
try {
|
||||
fromDirectory = fs.realpathSync(fromDirectory);
|
||||
} catch (error) {
|
||||
if (error.code === 'ENOENT') {
|
||||
fromDirectory = path.resolve(fromDirectory);
|
||||
} else if (silent) {
|
||||
return;
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
const fromFile = path.join(fromDirectory, 'noop.js');
|
||||
|
||||
const resolveFileName = () => Module._resolveFilename(moduleId, {
|
||||
id: fromFile,
|
||||
filename: fromFile,
|
||||
paths: Module._nodeModulePaths(fromDirectory)
|
||||
});
|
||||
|
||||
if (silent) {
|
||||
try {
|
||||
return resolveFileName();
|
||||
} catch (error) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
return resolveFileName();
|
||||
};
|
||||
|
||||
module.exports = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId);
|
||||
module.exports.silent = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId, true);
|
9
node_modules/nyc/node_modules/resolve-from/license
generated
vendored
Normal file
9
node_modules/nyc/node_modules/resolve-from/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.
|
36
node_modules/nyc/node_modules/resolve-from/package.json
generated
vendored
Normal file
36
node_modules/nyc/node_modules/resolve-from/package.json
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "resolve-from",
|
||||
"version": "5.0.0",
|
||||
"description": "Resolve the path of a module like `require.resolve()` but from a given path",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/resolve-from",
|
||||
"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": [
|
||||
"require",
|
||||
"resolve",
|
||||
"path",
|
||||
"module",
|
||||
"from",
|
||||
"like",
|
||||
"import"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
72
node_modules/nyc/node_modules/resolve-from/readme.md
generated
vendored
Normal file
72
node_modules/nyc/node_modules/resolve-from/readme.md
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
# resolve-from [](https://travis-ci.org/sindresorhus/resolve-from)
|
||||
|
||||
> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install resolve-from
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const resolveFrom = require('resolve-from');
|
||||
|
||||
// There is a file at `./foo/bar.js`
|
||||
|
||||
resolveFrom('foo', './bar');
|
||||
//=> '/Users/sindresorhus/dev/test/foo/bar.js'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### resolveFrom(fromDirectory, moduleId)
|
||||
|
||||
Like `require()`, throws when the module can't be found.
|
||||
|
||||
### resolveFrom.silent(fromDirectory, moduleId)
|
||||
|
||||
Returns `undefined` instead of throwing when the module can't be found.
|
||||
|
||||
#### fromDirectory
|
||||
|
||||
Type: `string`
|
||||
|
||||
Directory to resolve from.
|
||||
|
||||
#### moduleId
|
||||
|
||||
Type: `string`
|
||||
|
||||
What you would use in `require()`.
|
||||
|
||||
|
||||
## Tip
|
||||
|
||||
Create a partial using a bound function if you want to resolve from the same `fromDirectory` multiple times:
|
||||
|
||||
```js
|
||||
const resolveFromFoo = resolveFrom.bind(null, 'foo');
|
||||
|
||||
resolveFromFoo('./bar');
|
||||
resolveFromFoo('./baz');
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory
|
||||
- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path
|
||||
- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory
|
||||
- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point
|
||||
- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily
|
||||
- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
29
node_modules/nyc/node_modules/string-width/index.d.ts
generated
vendored
Normal file
29
node_modules/nyc/node_modules/string-width/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
declare const stringWidth: {
|
||||
/**
|
||||
Get the visual width of a string - the number of columns required to display it.
|
||||
|
||||
Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
|
||||
|
||||
@example
|
||||
```
|
||||
import stringWidth = require('string-width');
|
||||
|
||||
stringWidth('a');
|
||||
//=> 1
|
||||
|
||||
stringWidth('古');
|
||||
//=> 2
|
||||
|
||||
stringWidth('\u001B[1m古\u001B[22m');
|
||||
//=> 2
|
||||
```
|
||||
*/
|
||||
(string: string): number;
|
||||
|
||||
// TODO: remove this in the next major version, refactor the whole definition to:
|
||||
// declare function stringWidth(string: string): number;
|
||||
// export = stringWidth;
|
||||
default: typeof stringWidth;
|
||||
}
|
||||
|
||||
export = stringWidth;
|
43
node_modules/nyc/node_modules/string-width/index.js
generated
vendored
Normal file
43
node_modules/nyc/node_modules/string-width/index.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
'use strict';
|
||||
const stripAnsi = require('strip-ansi');
|
||||
const isFullwidthCodePoint = require('is-fullwidth-code-point');
|
||||
const emojiRegex = require('emoji-regex');
|
||||
|
||||
const stringWidth = string => {
|
||||
string = string.replace(emojiRegex(), ' ');
|
||||
|
||||
if (typeof string !== 'string' || string.length === 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
string = stripAnsi(string);
|
||||
|
||||
let width = 0;
|
||||
|
||||
for (let i = 0; i < string.length; i++) {
|
||||
const code = string.codePointAt(i);
|
||||
|
||||
// Ignore control characters
|
||||
if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Ignore combining characters
|
||||
if (code >= 0x300 && code <= 0x36F) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Surrogates
|
||||
if (code > 0xFFFF) {
|
||||
i++;
|
||||
}
|
||||
|
||||
width += isFullwidthCodePoint(code) ? 2 : 1;
|
||||
}
|
||||
|
||||
return width;
|
||||
};
|
||||
|
||||
module.exports = stringWidth;
|
||||
// TODO: remove this in the next major version
|
||||
module.exports.default = stringWidth;
|
9
node_modules/nyc/node_modules/string-width/license
generated
vendored
Normal file
9
node_modules/nyc/node_modules/string-width/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.
|
56
node_modules/nyc/node_modules/string-width/package.json
generated
vendored
Normal file
56
node_modules/nyc/node_modules/string-width/package.json
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "string-width",
|
||||
"version": "4.2.0",
|
||||
"description": "Get the visual width of a string - the number of columns required to display it",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/string-width",
|
||||
"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": [
|
||||
"string",
|
||||
"character",
|
||||
"unicode",
|
||||
"width",
|
||||
"visual",
|
||||
"column",
|
||||
"columns",
|
||||
"fullwidth",
|
||||
"full-width",
|
||||
"full",
|
||||
"ansi",
|
||||
"escape",
|
||||
"codes",
|
||||
"cli",
|
||||
"command-line",
|
||||
"terminal",
|
||||
"console",
|
||||
"cjk",
|
||||
"chinese",
|
||||
"japanese",
|
||||
"korean",
|
||||
"fixed-width"
|
||||
],
|
||||
"dependencies": {
|
||||
"emoji-regex": "^8.0.0",
|
||||
"is-fullwidth-code-point": "^3.0.0",
|
||||
"strip-ansi": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.1",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
50
node_modules/nyc/node_modules/string-width/readme.md
generated
vendored
Normal file
50
node_modules/nyc/node_modules/string-width/readme.md
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
# string-width [](https://travis-ci.org/sindresorhus/string-width)
|
||||
|
||||
> Get the visual width of a string - the number of columns required to display it
|
||||
|
||||
Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
|
||||
|
||||
Useful to be able to measure the actual width of command-line output.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install string-width
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const stringWidth = require('string-width');
|
||||
|
||||
stringWidth('a');
|
||||
//=> 1
|
||||
|
||||
stringWidth('古');
|
||||
//=> 2
|
||||
|
||||
stringWidth('\u001B[1m古\u001B[22m');
|
||||
//=> 2
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module
|
||||
- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string
|
||||
- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string
|
||||
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-string-width?utm_source=npm-string-width&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user