initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
105
github/codeql-action-v2/node_modules/slice-ansi/index.js
generated
vendored
Executable file
105
github/codeql-action-v2/node_modules/slice-ansi/index.js
generated
vendored
Executable file
|
|
@ -0,0 +1,105 @@
|
|||
import isFullwidthCodePoint from 'is-fullwidth-code-point';
|
||||
import ansiStyles from 'ansi-styles';
|
||||
|
||||
const astralRegex = /^[\uD800-\uDBFF][\uDC00-\uDFFF]$/;
|
||||
|
||||
const ESCAPES = [
|
||||
'\u001B',
|
||||
'\u009B'
|
||||
];
|
||||
|
||||
const wrapAnsi = code => `${ESCAPES[0]}[${code}m`;
|
||||
|
||||
const checkAnsi = (ansiCodes, isEscapes, endAnsiCode) => {
|
||||
let output = [];
|
||||
ansiCodes = [...ansiCodes];
|
||||
|
||||
for (let ansiCode of ansiCodes) {
|
||||
const ansiCodeOrigin = ansiCode;
|
||||
if (ansiCode.includes(';')) {
|
||||
ansiCode = ansiCode.split(';')[0][0] + '0';
|
||||
}
|
||||
|
||||
const item = ansiStyles.codes.get(Number.parseInt(ansiCode, 10));
|
||||
if (item) {
|
||||
const indexEscape = ansiCodes.indexOf(item.toString());
|
||||
if (indexEscape === -1) {
|
||||
output.push(wrapAnsi(isEscapes ? item : ansiCodeOrigin));
|
||||
} else {
|
||||
ansiCodes.splice(indexEscape, 1);
|
||||
}
|
||||
} else if (isEscapes) {
|
||||
output.push(wrapAnsi(0));
|
||||
break;
|
||||
} else {
|
||||
output.push(wrapAnsi(ansiCodeOrigin));
|
||||
}
|
||||
}
|
||||
|
||||
if (isEscapes) {
|
||||
output = output.filter((element, index) => output.indexOf(element) === index);
|
||||
|
||||
if (endAnsiCode !== undefined) {
|
||||
const fistEscapeCode = wrapAnsi(ansiStyles.codes.get(Number.parseInt(endAnsiCode, 10)));
|
||||
// TODO: Remove the use of `.reduce` here.
|
||||
// eslint-disable-next-line unicorn/no-array-reduce
|
||||
output = output.reduce((current, next) => next === fistEscapeCode ? [next, ...current] : [...current, next], []);
|
||||
}
|
||||
}
|
||||
|
||||
return output.join('');
|
||||
};
|
||||
|
||||
export default function sliceAnsi(string, begin, end) {
|
||||
const characters = [...string];
|
||||
const ansiCodes = [];
|
||||
|
||||
let stringEnd = typeof end === 'number' ? end : characters.length;
|
||||
let isInsideEscape = false;
|
||||
let ansiCode;
|
||||
let visible = 0;
|
||||
let output = '';
|
||||
|
||||
for (const [index, character] of characters.entries()) {
|
||||
let leftEscape = false;
|
||||
|
||||
if (ESCAPES.includes(character)) {
|
||||
const code = /\d[^m]*/.exec(string.slice(index, index + 18));
|
||||
ansiCode = code && code.length > 0 ? code[0] : undefined;
|
||||
|
||||
if (visible < stringEnd) {
|
||||
isInsideEscape = true;
|
||||
|
||||
if (ansiCode !== undefined) {
|
||||
ansiCodes.push(ansiCode);
|
||||
}
|
||||
}
|
||||
} else if (isInsideEscape && character === 'm') {
|
||||
isInsideEscape = false;
|
||||
leftEscape = true;
|
||||
}
|
||||
|
||||
if (!isInsideEscape && !leftEscape) {
|
||||
visible++;
|
||||
}
|
||||
|
||||
if (!astralRegex.test(character) && isFullwidthCodePoint(character.codePointAt())) {
|
||||
visible++;
|
||||
|
||||
if (typeof end !== 'number') {
|
||||
stringEnd++;
|
||||
}
|
||||
}
|
||||
|
||||
if (visible > begin && visible <= stringEnd) {
|
||||
output += character;
|
||||
} else if (visible === begin && !isInsideEscape && ansiCode !== undefined) {
|
||||
output = checkAnsi(ansiCodes);
|
||||
} else if (visible >= stringEnd) {
|
||||
output += checkAnsi(ansiCodes, true, ansiCode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
10
github/codeql-action-v2/node_modules/slice-ansi/license
generated
vendored
Normal file
10
github/codeql-action-v2/node_modules/slice-ansi/license
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) DC <threedeecee@gmail.com>
|
||||
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.
|
||||
17
github/codeql-action-v2/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/index.d.ts
generated
vendored
Normal file
17
github/codeql-action-v2/node_modules/slice-ansi/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;
|
||||
40
github/codeql-action-v2/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/index.js
generated
vendored
Normal file
40
github/codeql-action-v2/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/* eslint-disable yoda */
|
||||
|
||||
export default function isFullwidthCodePoint(codePoint) {
|
||||
if (!Number.isInteger(codePoint)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Code points are derived from:
|
||||
// https://unicode.org/Public/UNIDATA/EastAsianWidth.txt
|
||||
return 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)
|
||||
);
|
||||
}
|
||||
9
github/codeql-action-v2/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/license
generated
vendored
Normal file
9
github/codeql-action-v2/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/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.
|
||||
45
github/codeql-action-v2/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/package.json
generated
vendored
Normal file
45
github/codeql-action-v2/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
"name": "is-fullwidth-code-point",
|
||||
"version": "4.0.0",
|
||||
"description": "Check if the character represented by a given Unicode code point is fullwidth",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/is-fullwidth-code-point",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": "./index.js",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"fullwidth",
|
||||
"full-width",
|
||||
"full",
|
||||
"width",
|
||||
"unicode",
|
||||
"character",
|
||||
"string",
|
||||
"codepoint",
|
||||
"code",
|
||||
"point",
|
||||
"is",
|
||||
"detect",
|
||||
"check"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^3.15.0",
|
||||
"tsd": "^0.14.0",
|
||||
"xo": "^0.38.2"
|
||||
}
|
||||
}
|
||||
43
github/codeql-action-v2/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/readme.md
generated
vendored
Normal file
43
github/codeql-action-v2/node_modules/slice-ansi/node_modules/is-fullwidth-code-point/readme.md
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# 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
|
||||
import isFullwidthCodePoint from '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.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-is-fullwidth-code-point?utm_source=npm-is-fullwidth-code-point&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>
|
||||
53
github/codeql-action-v2/node_modules/slice-ansi/package.json
generated
vendored
Normal file
53
github/codeql-action-v2/node_modules/slice-ansi/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
"name": "slice-ansi",
|
||||
"version": "5.0.0",
|
||||
"description": "Slice a string with ANSI escape codes",
|
||||
"license": "MIT",
|
||||
"repository": "chalk/slice-ansi",
|
||||
"funding": "https://github.com/chalk/slice-ansi?sponsor=1",
|
||||
"type": "module",
|
||||
"exports": "./index.js",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"slice",
|
||||
"string",
|
||||
"ansi",
|
||||
"styles",
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"tty",
|
||||
"escape",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"log",
|
||||
"logging",
|
||||
"command-line",
|
||||
"text"
|
||||
],
|
||||
"dependencies": {
|
||||
"ansi-styles": "^6.0.0",
|
||||
"is-fullwidth-code-point": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^3.15.0",
|
||||
"chalk": "^4.1.0",
|
||||
"random-item": "^4.0.0",
|
||||
"strip-ansi": "^7.0.0",
|
||||
"xo": "^0.38.2"
|
||||
}
|
||||
}
|
||||
66
github/codeql-action-v2/node_modules/slice-ansi/readme.md
generated
vendored
Normal file
66
github/codeql-action-v2/node_modules/slice-ansi/readme.md
generated
vendored
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
# slice-ansi [](https://github.com/xojs/xo)
|
||||
|
||||
> Slice a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles)
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install slice-ansi
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import chalk from 'chalk';
|
||||
import sliceAnsi from 'slice-ansi';
|
||||
|
||||
const string = 'The quick brown ' + chalk.red('fox jumped over ') +
|
||||
'the lazy ' + chalk.green('dog and then ran away with the unicorn.');
|
||||
|
||||
console.log(sliceAnsi(string, 20, 30));
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### sliceAnsi(string, beginSlice, endSlice?)
|
||||
|
||||
#### string
|
||||
|
||||
Type: `string`
|
||||
|
||||
String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk).
|
||||
|
||||
#### beginSlice
|
||||
|
||||
Type: `number`
|
||||
|
||||
Zero-based index at which to begin the slice.
|
||||
|
||||
#### endSlice
|
||||
|
||||
Type: `number`
|
||||
|
||||
Zero-based index at which to end the slice.
|
||||
|
||||
## Related
|
||||
|
||||
- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
|
||||
- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal
|
||||
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
|
||||
|
||||
## 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-slice_ansi?utm_source=npm-slice-ansi&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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue