Fix actions/tour

This commit is contained in:
2025-02-13 23:19:32 +01:00
parent 47dd1adb30
commit fa21d30994
4543 changed files with 680810 additions and 0 deletions

17
node_modules/slashes/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,17 @@
ISC License
Copyright (c) 2022 Chris Ackerman
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
Chris Ackerman
DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
Chris Ackerman
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.

103
node_modules/slashes/README.md generated vendored Normal file
View File

@@ -0,0 +1,103 @@
# Slashes
Add or remove backslashes (escape or unescape).
[![build](https://github.com/Shakeskeyboarde/slashes/actions/workflows/build.yml/badge.svg)](https://github.com/Shakeskeyboarde/slashes/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/Shakeskeyboarde/slashes/branch/main/graph/badge.svg?token=E2VYI8XJLB)](https://codecov.io/gh/Shakeskeyboarde/slashes)
# Getting started
```ts
import { addSlashes, removeSlashes } from 'slashes';
addSlashes(`foo\nbar`); // "foo\\nbar"
removeSlashes(`foo\\nbar`); // "foo\nbar"
```
## Adding slashes
By default, `addSlashes` will escape (encode) the following characters.
- Backspace (`\b`)
- Form Feed (`\f`)
- Newline (`\n`)
- Carriage Return (`\r`)
- Horizontal Tab (`\t`)
- Vertical Tab (`\v`)
- Null (`\0`)
- Double Quote (`"`)
- Backslash (`\`)
```ts
const escaped = addSlashes(`\n`); // "\\n"
```
The default character set are characters which cannot be used between double quotes in a JSON string.
```ts
const validJsonString = `{ "key": "${escaped}" }`;
```
### Custom encoding
Escape encoding can be customized using the `getEscaped` option.
The following is the default, equivalent to not setting the `getEscaped` option.
```ts
import { getEscapedJsonUnsafe } from 'slashes';
addSlashes('...', { getEscaped: getEscapedJsonUnsafe });
```
Included `getEscaped` implementations:
- `getEscapedJsonUnsafe` - (Default) Encode characters which cannot be used between double quotes in a JSON string.
- `getEscapedAny` - Encode _ANY_ character to a single letter (eg. `\n`) or an ES5 Unicode (eg. `\u0100`) escape sequence.
A custom `getEscaped` receives one character (may be Unicode > 2 bytes) at a time. It can return `true` to use the standard escape sequence, `false` to not escape the character, or a string to provide a custom escape sequence (must begin with a backslash and be at least 2 characters long).
```ts
getEscaped(character: string): boolean | `\\${string}`
```
## Removing slashes
Be default, `removeSlashes` will unescape (decode) all Javascript escape sequences.
```ts
// Handles letter escapes
removeSlashes(`\\n`); // "\n"
// Handles ES6 Unicode Code Point escapes
removeSlashes('\\u{a}'); // "\n"
// Handles ES5 Unicode escapes
removeSlashes('\u000a'); // "\n"
// Handles hex escapes
removeSlashes('\x0a'); // "\n"
// Handles octal escapes
removeSlashes('\12'); // "\n"
// Handles any other backslash sequence by removing the leading slash
removeSlashes(`\\a`); // "a"
```
### Custom decoding
Although it should generally not be necessary because all escapes are handled by default, escape decoding can be customized using the `getUnescaped` option.
The following is the default, equivalent to not setting the `getUnescaped` option.
```ts
import { getUnescapedAny } from 'slashes';
removeSlashes('...', { getUnescaped: getUnescapedAny });
```
Included `getUnescaped` implementations:
- `getUnescapedAny` - Decode _ANY_ Javascript supported escape sequence.
A custom `getUnescaped` implementation receives the escape sequence as the first argument, and the escape sequence code point number or `null` (for single letter escape sequences) as the second argument. It can return `true` to use the standard decoding, `false` to treat the sequence as invalid (only removes the leading backslash), or a string (non-zero length) to provide a custom decoded value for the escape sequence.
```ts
getUnescaped(sequence: `\\${string}`, code: number | null): boolean | string
```

24
node_modules/slashes/lib/cjs/add-slashes.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addSlashes = void 0;
const get_escaped_any_js_1 = require("./get-escaped-any.js");
const get_escaped_json_unsafe_js_1 = require("./get-escaped-json-unsafe.js");
const addSlashes = (str, options = {}) => {
const { getEscaped = get_escaped_json_unsafe_js_1.getEscapedJsonUnsafe } = options;
let result = '';
for (const char of str) {
const escaped = getEscaped(char);
if (!escaped) {
result += char;
}
else if (escaped === true || escaped.length < 2) {
result += (0, get_escaped_any_js_1.getEscapedAny)(char) || char;
}
else {
result += escaped;
}
}
return result;
};
exports.addSlashes = addSlashes;
//# sourceMappingURL=add-slashes.js.map

1
node_modules/slashes/lib/cjs/add-slashes.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"add-slashes.js","sourceRoot":"","sources":["../../src/add-slashes.ts"],"names":[],"mappings":";;;AAAA,6DAAqD;AACrD,6EAAoE;AAgCpE,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,UAA6B,EAAE,EAAU,EAAE;IAC1E,MAAM,EAAE,UAAU,GAAG,iDAAoB,EAAE,GAAG,OAAO,CAAC;IACtD,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE;QACtB,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QAEjC,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,IAAI,IAAI,CAAC;SAChB;aAAM,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;YACjD,MAAM,IAAI,IAAA,kCAAa,EAAC,IAAI,CAAC,IAAI,IAAI,CAAC;SACvC;aAAM;YACL,MAAM,IAAI,OAAO,CAAC;SACnB;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAE+B,gCAAU"}

27
node_modules/slashes/lib/cjs/get-escaped-any.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getEscapedAny = void 0;
const getEscapedAny = (char) => {
switch (char) {
case '\b':
return '\\b';
case '\f':
return '\\f';
case '\n':
return '\\n';
case '\r':
return '\\r';
case '\t':
return '\\t';
case `"`:
case '\\':
return `\\${char}`;
}
let unicode = '';
for (let index = char.length - 1; index >= 0; index--) {
unicode = `\\u${('000' + char.charCodeAt(index).toString(16)).slice(-4)}${unicode}`;
}
return unicode || false;
};
exports.getEscapedAny = getEscapedAny;
//# sourceMappingURL=get-escaped-any.js.map

1
node_modules/slashes/lib/cjs/get-escaped-any.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"get-escaped-any.js","sourceRoot":"","sources":["../../src/get-escaped-any.ts"],"names":[],"mappings":";;;AAMA,MAAM,aAAa,GAAG,CAAC,IAAY,EAA0B,EAAE;IAC7D,QAAQ,IAAI,EAAE;QACZ,KAAK,IAAI;YACP,OAAO,KAAK,CAAC;QACf,KAAK,IAAI;YACP,OAAO,KAAK,CAAC;QACf,KAAK,IAAI;YACP,OAAO,KAAK,CAAC;QACf,KAAK,IAAI;YACP,OAAO,KAAK,CAAC;QACf,KAAK,IAAI;YACP,OAAO,KAAK,CAAC;QACf,KAAK,GAAG,CAAC;QACT,KAAK,IAAI;YACP,OAAO,KAAK,IAAI,EAAE,CAAC;KACtB;IAED,IAAI,OAAO,GAAwB,EAAE,CAAC;IAEtC,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE;QACrD,OAAO,GAAG,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,EAAW,CAAC;KAC9F;IAED,OAAO,OAAO,IAAI,KAAK,CAAC;AAC1B,CAAC,CAAC;AAEO,sCAAa"}

View File

@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getEscapedJsonUnsafe = void 0;
const getEscapedJsonUnsafe = (char) => {
switch (char) {
case '\b':
case '\f':
case '\n':
case '\r':
case '\t':
case '\v':
case '\0':
case `"`:
case '\\':
return true;
}
return false;
};
exports.getEscapedJsonUnsafe = getEscapedJsonUnsafe;
//# sourceMappingURL=get-escaped-json-unsafe.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"get-escaped-json-unsafe.js","sourceRoot":"","sources":["../../src/get-escaped-json-unsafe.ts"],"names":[],"mappings":";;;AAgBA,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAW,EAAE;IACrD,QAAQ,IAAI,EAAE;QACZ,KAAK,IAAI,CAAC;QACV,KAAK,IAAI,CAAC;QACV,KAAK,IAAI,CAAC;QACV,KAAK,IAAI,CAAC;QACV,KAAK,IAAI,CAAC;QACV,KAAK,IAAI,CAAC;QACV,KAAK,IAAI,CAAC;QACV,KAAK,GAAG,CAAC;QACT,KAAK,IAAI;YACP,OAAO,IAAI,CAAC;KACf;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEO,oDAAoB"}

25
node_modules/slashes/lib/cjs/get-unescaped-any.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getUnescapedAny = void 0;
const getUnescapedAny = (sequence, code) => {
if (code != null) {
return String.fromCodePoint(code);
}
switch (sequence) {
case '\\b':
return '\b';
case '\\f':
return '\f';
case '\\n':
return '\n';
case '\\r':
return '\r';
case '\\t':
return '\t';
case '\\v':
return '\v';
}
return false;
};
exports.getUnescapedAny = getUnescapedAny;
//# sourceMappingURL=get-unescaped-any.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"get-unescaped-any.js","sourceRoot":"","sources":["../../src/get-unescaped-any.ts"],"names":[],"mappings":";;;AAEA,MAAM,eAAe,GAAG,CAAC,QAAwB,EAAE,IAAmB,EAAkB,EAAE;IACxF,IAAI,IAAI,IAAI,IAAI,EAAE;QAChB,OAAO,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;KACnC;IAED,QAAQ,QAAQ,EAAE;QAChB,KAAK,KAAK;YACR,OAAO,IAAI,CAAC;QACd,KAAK,KAAK;YACR,OAAO,IAAI,CAAC;QACd,KAAK,KAAK;YACR,OAAO,IAAI,CAAC;QACd,KAAK,KAAK;YACR,OAAO,IAAI,CAAC;QACd,KAAK,KAAK;YACR,OAAO,IAAI,CAAC;QACd,KAAK,KAAK;YACR,OAAO,IAAI,CAAC;KAKf;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEO,0CAAe"}

22
node_modules/slashes/lib/cjs/index.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./add-slashes.js"), exports);
__exportStar(require("./get-escaped-any.js"), exports);
__exportStar(require("./get-escaped-json-unsafe.js"), exports);
__exportStar(require("./get-unescaped-any.js"), exports);
__exportStar(require("./remove-slashes.js"), exports);
//# sourceMappingURL=index.js.map

1
node_modules/slashes/lib/cjs/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,uDAAqC;AACrC,+DAA6C;AAC7C,yDAAuC;AACvC,sDAAoC"}

1
node_modules/slashes/lib/cjs/package.json generated vendored Normal file
View File

@@ -0,0 +1 @@
{ "type": "commonjs" }

47
node_modules/slashes/lib/cjs/remove-slashes.js generated vendored Normal file
View File

@@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stripSlashes = exports.removeSlashes = void 0;
const get_unescaped_any_js_1 = require("./get-unescaped-any.js");
const removeSlashes = (source, options = {}) => {
const { getUnescaped = get_unescaped_any_js_1.getUnescapedAny } = options;
const rx = /(?:(\\(u([0-9a-f]{4})|u\{([0-9a-f]+)\}|x([0-9a-f]{2})|(\d{1,3})|([\s\S]|$)))|([\s\S]))/giu;
let match;
let result = '';
while (null != (match = rx.exec(source))) {
const [, sequence, fallback, unicode, unicodePoint, hex, octal, char, literal] = match;
if (literal) {
result += literal;
continue;
}
let code;
if (char != null) {
code = null;
}
else if (octal) {
code = Number.parseInt(octal, 8);
}
else {
code = Number.parseInt((unicodePoint || unicode || hex), 16);
}
try {
const unescaped = getUnescaped(sequence, code);
if (!unescaped) {
result += fallback;
}
else if (unescaped === true) {
result += (0, get_unescaped_any_js_1.getUnescapedAny)(sequence, code) || fallback;
}
else {
result += unescaped;
}
}
catch (_error) {
result += fallback;
}
}
return result;
};
exports.removeSlashes = removeSlashes;
const stripSlashes = removeSlashes;
exports.stripSlashes = stripSlashes;
//# sourceMappingURL=remove-slashes.js.map

1
node_modules/slashes/lib/cjs/remove-slashes.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"remove-slashes.js","sourceRoot":"","sources":["../../src/remove-slashes.ts"],"names":[],"mappings":";;;AAAA,iEAAyD;AAazD,MAAM,aAAa,GAAG,CAAC,MAAc,EAAE,UAAgC,EAAE,EAAU,EAAE;IACnF,MAAM,EAAE,YAAY,GAAG,sCAAe,EAAE,GAAG,OAAO,CAAC;IACnD,MAAM,EAAE,GAAG,2FAA2F,CAAC;IAEvG,IAAI,KAA6B,CAAC;IAClC,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,OAAO,IAAI,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE;QACxC,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC;QAEvF,IAAI,OAAO,EAAE;YACX,MAAM,IAAI,OAAO,CAAC;YAClB,SAAS;SACV;QAED,IAAI,IAAmB,CAAC;QAExB,IAAI,IAAI,IAAI,IAAI,EAAE;YAChB,IAAI,GAAG,IAAI,CAAC;SACb;aAAM,IAAI,KAAK,EAAE;YAChB,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SAClC;aAAM;YACL,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,IAAI,OAAO,IAAI,GAAG,CAAW,EAAE,EAAE,CAAC,CAAC;SACxE;QAED,IAAI;YACF,MAAM,SAAS,GAAG,YAAY,CAAC,QAA0B,EAAE,IAAI,CAAC,CAAC;YAEjE,IAAI,CAAC,SAAS,EAAE;gBACd,MAAM,IAAI,QAAQ,CAAC;aACpB;iBAAM,IAAI,SAAS,KAAK,IAAI,EAAE;gBAC7B,MAAM,IAAI,IAAA,sCAAe,EAAC,QAA0B,EAAE,IAAI,CAAC,IAAI,QAAQ,CAAC;aACzE;iBAAM;gBACL,MAAM,IAAI,SAAS,CAAC;aACrB;SACF;QAAC,OAAO,MAAM,EAAE;YACf,MAAM,IAAI,QAAQ,CAAC;SACpB;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAOO,sCAAa;AAFtB,MAAM,YAAY,GAAG,aAAa,CAAC;AAEX,oCAAY"}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=escape-sequence.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"escape-sequence.js","sourceRoot":"","sources":["../../../src/types/escape-sequence.ts"],"names":[],"mappings":""}

21
node_modules/slashes/lib/esm/add-slashes.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
import { getEscapedAny } from './get-escaped-any.js';
import { getEscapedJsonUnsafe } from './get-escaped-json-unsafe.js';
const addSlashes = (str, options = {}) => {
const { getEscaped = getEscapedJsonUnsafe } = options;
let result = '';
for (const char of str) {
const escaped = getEscaped(char);
if (!escaped) {
result += char;
}
else if (escaped === true || escaped.length < 2) {
result += getEscapedAny(char) || char;
}
else {
result += escaped;
}
}
return result;
};
export { addSlashes };
//# sourceMappingURL=add-slashes.js.map

1
node_modules/slashes/lib/esm/add-slashes.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"add-slashes.js","sourceRoot":"","sources":["../../src/add-slashes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAgCpE,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,UAA6B,EAAE,EAAU,EAAE;IAC1E,MAAM,EAAE,UAAU,GAAG,oBAAoB,EAAE,GAAG,OAAO,CAAC;IACtD,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE;QACtB,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QAEjC,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,IAAI,IAAI,CAAC;SAChB;aAAM,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;YACjD,MAAM,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;SACvC;aAAM;YACL,MAAM,IAAI,OAAO,CAAC;SACnB;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,OAAO,EAA0B,UAAU,EAAE,CAAC"}

24
node_modules/slashes/lib/esm/get-escaped-any.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
const getEscapedAny = (char) => {
switch (char) {
case '\b':
return '\\b';
case '\f':
return '\\f';
case '\n':
return '\\n';
case '\r':
return '\\r';
case '\t':
return '\\t';
case `"`:
case '\\':
return `\\${char}`;
}
let unicode = '';
for (let index = char.length - 1; index >= 0; index--) {
unicode = `\\u${('000' + char.charCodeAt(index).toString(16)).slice(-4)}${unicode}`;
}
return unicode || false;
};
export { getEscapedAny };
//# sourceMappingURL=get-escaped-any.js.map

1
node_modules/slashes/lib/esm/get-escaped-any.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"get-escaped-any.js","sourceRoot":"","sources":["../../src/get-escaped-any.ts"],"names":[],"mappings":"AAMA,MAAM,aAAa,GAAG,CAAC,IAAY,EAA0B,EAAE;IAC7D,QAAQ,IAAI,EAAE;QACZ,KAAK,IAAI;YACP,OAAO,KAAK,CAAC;QACf,KAAK,IAAI;YACP,OAAO,KAAK,CAAC;QACf,KAAK,IAAI;YACP,OAAO,KAAK,CAAC;QACf,KAAK,IAAI;YACP,OAAO,KAAK,CAAC;QACf,KAAK,IAAI;YACP,OAAO,KAAK,CAAC;QACf,KAAK,GAAG,CAAC;QACT,KAAK,IAAI;YACP,OAAO,KAAK,IAAI,EAAE,CAAC;KACtB;IAED,IAAI,OAAO,GAAwB,EAAE,CAAC;IAEtC,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE;QACrD,OAAO,GAAG,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,EAAW,CAAC;KAC9F;IAED,OAAO,OAAO,IAAI,KAAK,CAAC;AAC1B,CAAC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}

View File

@@ -0,0 +1,17 @@
const getEscapedJsonUnsafe = (char) => {
switch (char) {
case '\b':
case '\f':
case '\n':
case '\r':
case '\t':
case '\v':
case '\0':
case `"`:
case '\\':
return true;
}
return false;
};
export { getEscapedJsonUnsafe };
//# sourceMappingURL=get-escaped-json-unsafe.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"get-escaped-json-unsafe.js","sourceRoot":"","sources":["../../src/get-escaped-json-unsafe.ts"],"names":[],"mappings":"AAgBA,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAW,EAAE;IACrD,QAAQ,IAAI,EAAE;QACZ,KAAK,IAAI,CAAC;QACV,KAAK,IAAI,CAAC;QACV,KAAK,IAAI,CAAC;QACV,KAAK,IAAI,CAAC;QACV,KAAK,IAAI,CAAC;QACV,KAAK,IAAI,CAAC;QACV,KAAK,IAAI,CAAC;QACV,KAAK,GAAG,CAAC;QACT,KAAK,IAAI;YACP,OAAO,IAAI,CAAC;KACf;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}

22
node_modules/slashes/lib/esm/get-unescaped-any.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
const getUnescapedAny = (sequence, code) => {
if (code != null) {
return String.fromCodePoint(code);
}
switch (sequence) {
case '\\b':
return '\b';
case '\\f':
return '\f';
case '\\n':
return '\n';
case '\\r':
return '\r';
case '\\t':
return '\t';
case '\\v':
return '\v';
}
return false;
};
export { getUnescapedAny };
//# sourceMappingURL=get-unescaped-any.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"get-unescaped-any.js","sourceRoot":"","sources":["../../src/get-unescaped-any.ts"],"names":[],"mappings":"AAEA,MAAM,eAAe,GAAG,CAAC,QAAwB,EAAE,IAAmB,EAAkB,EAAE;IACxF,IAAI,IAAI,IAAI,IAAI,EAAE;QAChB,OAAO,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;KACnC;IAED,QAAQ,QAAQ,EAAE;QAChB,KAAK,KAAK;YACR,OAAO,IAAI,CAAC;QACd,KAAK,KAAK;YACR,OAAO,IAAI,CAAC;QACd,KAAK,KAAK;YACR,OAAO,IAAI,CAAC;QACd,KAAK,KAAK;YACR,OAAO,IAAI,CAAC;QACd,KAAK,KAAK;YACR,OAAO,IAAI,CAAC;QACd,KAAK,KAAK;YACR,OAAO,IAAI,CAAC;KAKf;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}

6
node_modules/slashes/lib/esm/index.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
export * from './add-slashes.js';
export * from './get-escaped-any.js';
export * from './get-escaped-json-unsafe.js';
export * from './get-unescaped-any.js';
export * from './remove-slashes.js';
//# sourceMappingURL=index.js.map

1
node_modules/slashes/lib/esm/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC"}

43
node_modules/slashes/lib/esm/remove-slashes.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
import { getUnescapedAny } from './get-unescaped-any.js';
const removeSlashes = (source, options = {}) => {
const { getUnescaped = getUnescapedAny } = options;
const rx = /(?:(\\(u([0-9a-f]{4})|u\{([0-9a-f]+)\}|x([0-9a-f]{2})|(\d{1,3})|([\s\S]|$)))|([\s\S]))/giu;
let match;
let result = '';
while (null != (match = rx.exec(source))) {
const [, sequence, fallback, unicode, unicodePoint, hex, octal, char, literal] = match;
if (literal) {
result += literal;
continue;
}
let code;
if (char != null) {
code = null;
}
else if (octal) {
code = Number.parseInt(octal, 8);
}
else {
code = Number.parseInt((unicodePoint || unicode || hex), 16);
}
try {
const unescaped = getUnescaped(sequence, code);
if (!unescaped) {
result += fallback;
}
else if (unescaped === true) {
result += getUnescapedAny(sequence, code) || fallback;
}
else {
result += unescaped;
}
}
catch (_error) {
result += fallback;
}
}
return result;
};
const stripSlashes = removeSlashes;
export { removeSlashes, stripSlashes };
//# sourceMappingURL=remove-slashes.js.map

1
node_modules/slashes/lib/esm/remove-slashes.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"remove-slashes.js","sourceRoot":"","sources":["../../src/remove-slashes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAazD,MAAM,aAAa,GAAG,CAAC,MAAc,EAAE,UAAgC,EAAE,EAAU,EAAE;IACnF,MAAM,EAAE,YAAY,GAAG,eAAe,EAAE,GAAG,OAAO,CAAC;IACnD,MAAM,EAAE,GAAG,2FAA2F,CAAC;IAEvG,IAAI,KAA6B,CAAC;IAClC,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,OAAO,IAAI,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE;QACxC,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC;QAEvF,IAAI,OAAO,EAAE;YACX,MAAM,IAAI,OAAO,CAAC;YAClB,SAAS;SACV;QAED,IAAI,IAAmB,CAAC;QAExB,IAAI,IAAI,IAAI,IAAI,EAAE;YAChB,IAAI,GAAG,IAAI,CAAC;SACb;aAAM,IAAI,KAAK,EAAE;YAChB,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SAClC;aAAM;YACL,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,IAAI,OAAO,IAAI,GAAG,CAAW,EAAE,EAAE,CAAC,CAAC;SACxE;QAED,IAAI;YACF,MAAM,SAAS,GAAG,YAAY,CAAC,QAA0B,EAAE,IAAI,CAAC,CAAC;YAEjE,IAAI,CAAC,SAAS,EAAE;gBACd,MAAM,IAAI,QAAQ,CAAC;aACpB;iBAAM,IAAI,SAAS,KAAK,IAAI,EAAE;gBAC7B,MAAM,IAAI,eAAe,CAAC,QAA0B,EAAE,IAAI,CAAC,IAAI,QAAQ,CAAC;aACzE;iBAAM;gBACL,MAAM,IAAI,SAAS,CAAC;aACrB;SACF;QAAC,OAAO,MAAM,EAAE;YACf,MAAM,IAAI,QAAQ,CAAC;SACpB;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAKF,MAAM,YAAY,GAAG,aAAa,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=escape-sequence.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"escape-sequence.js","sourceRoot":"","sources":["../../../src/types/escape-sequence.ts"],"names":[],"mappings":""}

31
node_modules/slashes/lib/types/add-slashes.d.ts generated vendored Normal file
View File

@@ -0,0 +1,31 @@
import { type EscapeSequence } from './types/escape-sequence.js';
type AddSlashesOptions = {
/**
* Indicate which characters should be encoded and how.
*
* - Return `false` to leave the character unencoded.
* - Return `true` to encode the character to its default escape sequence.
* - Return a string to provide a custom escape sequence.
*/
readonly getEscaped?: (char: string) => EscapeSequence | boolean;
};
/**
* Encode characters as escape sequences.
*
* By default, the following characters are encoded:
*
* - `\b` Backspace
* - `\f` Linefeed
* - `\n` Newline
* - `\r` Carriage Return
* - `\t` Tab
* - `\v` Vertical Tab
* - `\0` Null
* - `"` Double quote
* - `\` Backslash
*
* Use the `getEscaped` option to encode additional characters or to override
* the default escapes.
*/
declare const addSlashes: (str: string, options?: AddSlashesOptions) => string;
export { type AddSlashesOptions, addSlashes };

7
node_modules/slashes/lib/types/get-escaped-any.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
import { type EscapeSequence } from './types/escape-sequence.js';
/**
* Get escapes for any character, using JSON-safe single letter sequences, and
* ES5 unicode escapes (eg. `\u0100`).
*/
declare const getEscapedAny: (char: string) => EscapeSequence | false;
export { getEscapedAny };

View File

@@ -0,0 +1,18 @@
/**
* Get escapes for the default escape set, which is all characters that cannot
* be used between double quotes in a JSON string.
*
* - `\b` Backspace
* - `\f` Linefeed
* - `\n` Newline
* - `\r` Carriage Return
* - `\t` Tab
* - `\v` Vertical Tab
* - `\0` Null
* - `"` Double quote
*
* NOTE: Backslashes are always escaped by the `addSlashes` function and do
* not need to be escaped by the `getEscaped` implementation.
*/
declare const getEscapedJsonUnsafe: (char: string) => boolean;
export { getEscapedJsonUnsafe };

View File

@@ -0,0 +1,3 @@
import { type EscapeSequence } from './types/escape-sequence.js';
declare const getUnescapedAny: (sequence: EscapeSequence, code: number | null) => string | false;
export { getUnescapedAny };

5
node_modules/slashes/lib/types/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
export * from './add-slashes.js';
export * from './get-escaped-any.js';
export * from './get-escaped-json-unsafe.js';
export * from './get-unescaped-any.js';
export * from './remove-slashes.js';

16
node_modules/slashes/lib/types/remove-slashes.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
import { type EscapeSequence } from './types/escape-sequence.js';
type RemoveSlashesOptions = {
readonly getUnescaped?: (sequence: EscapeSequence, code: number | null) => boolean | string;
};
/**
* Remove one layer of slashes, decoding any Javascript escape sequences into
* their corresponding characters (eg. `\\n` would become a newline).
*
* Use the `getUnescaped` option to customize escape sequence decoding.
*/
declare const removeSlashes: (source: string, options?: RemoveSlashesOptions) => string;
/**
* @deprecated Use {@link removeSlashes} instead.
*/
declare const stripSlashes: (source: string, options?: RemoveSlashesOptions) => string;
export { removeSlashes, stripSlashes };

View File

@@ -0,0 +1,2 @@
type EscapeSequence = `\\${string}`;
export { type EscapeSequence };

58
node_modules/slashes/package.json generated vendored Normal file
View File

@@ -0,0 +1,58 @@
{
"name": "slashes",
"description": "Add or remove backslashes (escape or unescape).",
"author": {
"name": "Chris Ackerman",
"email": "chris@topher.land"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Shakeskeyboarde/slashes.git"
},
"license": "ISC",
"version": "3.0.12",
"files": [
"lib/**"
],
"directories": {
"lib": "lib"
},
"keywords": [
"escape",
"unescape",
"encode",
"decode",
"strip",
"json",
"php"
],
"type": "module",
"types": "lib/types/index.d.ts",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"exports": {
".": {
"types": "./lib/types/index.d.ts",
"require": "./lib/cjs/index.js",
"default": "./lib/esm/index.js"
}
},
"sideEffects": false,
"scripts": {
"test": "rc npm-test -o",
"prepack": "del-cli *.tgz && rc npm-prepack",
"modernize": "npx npm-check-updates -i --format group"
},
"devDependencies": {
"@types/jest": "^29.2.4",
"del-cli": "^5.0.0",
"eslint": "^8.30.0",
"eslint-config-rational": "^2.0.7",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"parallel-rc": "^1.0.12",
"prettier": "^2.8.1",
"ts-jest": "^29.0.3",
"typescript": "^4.9.4"
}
}