This commit is contained in:
2022-09-30 05:39:11 +00:00
parent 41ee9463ae
commit 4687fa49bc
11418 changed files with 1312504 additions and 0 deletions

59
buildfiles/app/node_modules/slice-ansi/index.js generated vendored Executable file
View File

@ -0,0 +1,59 @@
'use strict';
const isFullwidthCodePoint = require('is-fullwidth-code-point');
const astralRegex = require('astral-regex');
const ansiStyles = require('ansi-styles');
const ESCAPES = [
'\u001B',
'\u009B'
];
const END_CODE = 39;
const wrapAnsi = code => `${ESCAPES[0]}[${code}m`;
module.exports = (str, begin, end) => {
const arr = [...str.normalize()];
end = typeof end === 'number' ? end : arr.length;
let insideEscape = false;
let escapeCode = null;
let visible = 0;
let output = '';
for (const [i, x] of arr.entries()) {
let leftEscape = false;
if (ESCAPES.includes(x)) {
insideEscape = true;
const code = /\d[^m]*/.exec(str.slice(i, i + 18));
escapeCode = code === END_CODE ? null : code;
} else if (insideEscape && x === 'm') {
insideEscape = false;
leftEscape = true;
}
if (!insideEscape && !leftEscape) {
++visible;
}
if (!astralRegex({exact: true}).test(x) && isFullwidthCodePoint(x.codePointAt())) {
++visible;
}
if (visible > begin && visible <= end) {
output += x;
} else if (visible === begin && !insideEscape && escapeCode !== null && escapeCode !== END_CODE) {
output += wrapAnsi(escapeCode);
} else if (visible >= end) {
if (escapeCode !== null) {
output += wrapAnsi(ansiStyles.codes.get(parseInt(escapeCode, 10)) || END_CODE);
}
break;
}
}
return output;
};

9
buildfiles/app/node_modules/slice-ansi/license generated vendored Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) DC <threedeecee@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.

87
buildfiles/app/node_modules/slice-ansi/package.json generated vendored Normal file
View File

@ -0,0 +1,87 @@
{
"_args": [
[
"slice-ansi@2.1.0",
"/home/shihaam/www/freezer.shihaam.me/app"
]
],
"_development": true,
"_from": "slice-ansi@2.1.0",
"_id": "slice-ansi@2.1.0",
"_inBundle": false,
"_integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==",
"_location": "/slice-ansi",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "slice-ansi@2.1.0",
"name": "slice-ansi",
"escapedName": "slice-ansi",
"rawSpec": "2.1.0",
"saveSpec": null,
"fetchSpec": "2.1.0"
},
"_requiredBy": [
"/table"
],
"_resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz",
"_spec": "2.1.0",
"_where": "/home/shihaam/www/freezer.shihaam.me/app",
"bugs": {
"url": "https://github.com/chalk/slice-ansi/issues"
},
"dependencies": {
"ansi-styles": "^3.2.0",
"astral-regex": "^1.0.0",
"is-fullwidth-code-point": "^2.0.0"
},
"description": "Slice a string with ANSI escape codes",
"devDependencies": {
"ava": "^1.1.0",
"chalk": "^2.4.2",
"random-item": "^1.0.0",
"strip-ansi": "^5.0.0",
"xo": "^0.24.0"
},
"engines": {
"node": ">=6"
},
"files": [
"index.js"
],
"homepage": "https://github.com/chalk/slice-ansi#readme",
"keywords": [
"slice",
"string",
"ansi",
"styles",
"color",
"colour",
"colors",
"terminal",
"console",
"cli",
"tty",
"escape",
"formatting",
"rgb",
"256",
"shell",
"xterm",
"log",
"logging",
"command-line",
"text"
],
"license": "MIT",
"name": "slice-ansi",
"repository": {
"type": "git",
"url": "git+https://github.com/chalk/slice-ansi.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "2.1.0"
}

64
buildfiles/app/node_modules/slice-ansi/readme.md generated vendored Normal file
View File

@ -0,0 +1,64 @@
# slice-ansi [![Build Status](https://travis-ci.org/chalk/slice-ansi.svg?branch=master)](https://travis-ci.org/chalk/slice-ansi) [![XO: Linted](https://img.shields.io/badge/xo-linted-blue.svg)](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
const chalk = require('chalk');
const sliceAnsi = require('slice-ansi');
const input = 'The quick brown ' + chalk.red('fox jumped over ') +
'the lazy ' + chalk.green('dog and then ran away with the unicorn.');
console.log(sliceAnsi(input, 20, 30));
```
## API
### sliceAnsi(input, beginSlice, [endSlice])
#### input
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-)
## License
MIT