llonebot-dist 6.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dist/default_config.json +68 -0
- dist/llonebot.js +48348 -0
- dist/llonebot.js.map +1 -0
- dist/node_modules/@borewit/text-codec/LICENSE.txt +9 -0
- dist/node_modules/@borewit/text-codec/README.md +76 -0
- dist/node_modules/@borewit/text-codec/lib/index.d.ts +8 -0
- dist/node_modules/@borewit/text-codec/lib/index.js +161 -0
- dist/node_modules/@borewit/text-codec/package.json +68 -0
- dist/node_modules/@minatojs/sql.js/LICENSE +44 -0
- dist/node_modules/@minatojs/sql.js/README.md +357 -0
- dist/node_modules/@minatojs/sql.js/dist/sql-wasm.d.ts +316 -0
- dist/node_modules/@minatojs/sql.js/dist/sql-wasm.js +225 -0
- dist/node_modules/@minatojs/sql.js/dist/sql-wasm.wasm +0 -0
- dist/node_modules/@minatojs/sql.js/package.json +58 -0
- dist/node_modules/@tokenizer/inflate/LICENSE +15 -0
- dist/node_modules/@tokenizer/inflate/README.md +114 -0
- dist/node_modules/@tokenizer/inflate/lib/GzipHandler.d.ts +6 -0
- dist/node_modules/@tokenizer/inflate/lib/GzipHandler.js +19 -0
- dist/node_modules/@tokenizer/inflate/lib/ZipHandler.d.ts +26 -0
- dist/node_modules/@tokenizer/inflate/lib/ZipHandler.js +233 -0
- dist/node_modules/@tokenizer/inflate/lib/ZipToken.d.ts +94 -0
- dist/node_modules/@tokenizer/inflate/lib/ZipToken.js +117 -0
- dist/node_modules/@tokenizer/inflate/lib/index.d.ts +3 -0
- dist/node_modules/@tokenizer/inflate/lib/index.js +2 -0
- dist/node_modules/@tokenizer/inflate/package.json +76 -0
- dist/node_modules/@tokenizer/token/README.md +19 -0
- dist/node_modules/@tokenizer/token/index.d.ts +30 -0
- dist/node_modules/@tokenizer/token/package.json +33 -0
- dist/node_modules/debug/LICENSE +20 -0
- dist/node_modules/debug/README.md +481 -0
- dist/node_modules/debug/package.json +64 -0
- dist/node_modules/debug/src/browser.js +272 -0
- dist/node_modules/debug/src/common.js +292 -0
- dist/node_modules/debug/src/index.js +10 -0
- dist/node_modules/debug/src/node.js +263 -0
- dist/node_modules/file-type/core.d.ts +253 -0
- dist/node_modules/file-type/core.js +1899 -0
- dist/node_modules/file-type/index.d.ts +98 -0
- dist/node_modules/file-type/index.js +86 -0
- dist/node_modules/file-type/license +9 -0
- dist/node_modules/file-type/package.json +288 -0
- dist/node_modules/file-type/readme.md +674 -0
- dist/node_modules/file-type/supported.js +356 -0
- dist/node_modules/file-type/util.js +60 -0
- dist/node_modules/ieee754/LICENSE +11 -0
- dist/node_modules/ieee754/README.md +51 -0
- dist/node_modules/ieee754/index.d.ts +10 -0
- dist/node_modules/ieee754/index.js +85 -0
- dist/node_modules/ieee754/package.json +52 -0
- dist/node_modules/ms/index.js +162 -0
- dist/node_modules/ms/license.md +21 -0
- dist/node_modules/ms/package.json +38 -0
- dist/node_modules/ms/readme.md +59 -0
- dist/node_modules/silk-wasm/LICENSE +21 -0
- dist/node_modules/silk-wasm/README.md +85 -0
- dist/node_modules/silk-wasm/lib/index.cjs +16 -0
- dist/node_modules/silk-wasm/lib/index.d.ts +70 -0
- dist/node_modules/silk-wasm/lib/index.mjs +16 -0
- dist/node_modules/silk-wasm/lib/silk.wasm +0 -0
- dist/node_modules/silk-wasm/lib/utils.d.ts +4 -0
- dist/node_modules/silk-wasm/package.json +39 -0
- dist/node_modules/strtok3/LICENSE.txt +21 -0
- dist/node_modules/strtok3/README.md +399 -0
- dist/node_modules/strtok3/lib/AbstractTokenizer.d.ts +76 -0
- dist/node_modules/strtok3/lib/AbstractTokenizer.js +108 -0
- dist/node_modules/strtok3/lib/BlobTokenizer.d.ts +29 -0
- dist/node_modules/strtok3/lib/BlobTokenizer.js +53 -0
- dist/node_modules/strtok3/lib/BufferTokenizer.d.ts +29 -0
- dist/node_modules/strtok3/lib/BufferTokenizer.js +52 -0
- dist/node_modules/strtok3/lib/FileTokenizer.d.ts +37 -0
- dist/node_modules/strtok3/lib/FileTokenizer.js +61 -0
- dist/node_modules/strtok3/lib/ReadStreamTokenizer.d.ts +31 -0
- dist/node_modules/strtok3/lib/ReadStreamTokenizer.js +102 -0
- dist/node_modules/strtok3/lib/core.d.ts +40 -0
- dist/node_modules/strtok3/lib/core.js +62 -0
- dist/node_modules/strtok3/lib/index.d.ts +16 -0
- dist/node_modules/strtok3/lib/index.js +22 -0
- dist/node_modules/strtok3/lib/stream/AbstractStreamReader.d.ts +54 -0
- dist/node_modules/strtok3/lib/stream/AbstractStreamReader.js +71 -0
- dist/node_modules/strtok3/lib/stream/Deferred.d.ts +6 -0
- dist/node_modules/strtok3/lib/stream/Deferred.js +10 -0
- dist/node_modules/strtok3/lib/stream/Errors.d.ts +10 -0
- dist/node_modules/strtok3/lib/stream/Errors.js +16 -0
- dist/node_modules/strtok3/lib/stream/StreamReader.d.ts +29 -0
- dist/node_modules/strtok3/lib/stream/StreamReader.js +83 -0
- dist/node_modules/strtok3/lib/stream/WebStreamByobReader.d.ts +14 -0
- dist/node_modules/strtok3/lib/stream/WebStreamByobReader.js +27 -0
- dist/node_modules/strtok3/lib/stream/WebStreamDefaultReader.d.ts +19 -0
- dist/node_modules/strtok3/lib/stream/WebStreamDefaultReader.js +62 -0
- dist/node_modules/strtok3/lib/stream/WebStreamReader.d.ts +14 -0
- dist/node_modules/strtok3/lib/stream/WebStreamReader.js +13 -0
- dist/node_modules/strtok3/lib/stream/WebStreamReaderFactory.d.ts +5 -0
- dist/node_modules/strtok3/lib/stream/WebStreamReaderFactory.js +19 -0
- dist/node_modules/strtok3/lib/stream/index.d.ts +6 -0
- dist/node_modules/strtok3/lib/stream/index.js +5 -0
- dist/node_modules/strtok3/lib/types.d.ts +139 -0
- dist/node_modules/strtok3/lib/types.js +1 -0
- dist/node_modules/strtok3/package.json +94 -0
- dist/node_modules/token-types/LICENSE.txt +9 -0
- dist/node_modules/token-types/README.md +120 -0
- dist/node_modules/token-types/lib/index.d.ts +135 -0
- dist/node_modules/token-types/lib/index.js +401 -0
- dist/node_modules/token-types/package.json +81 -0
- dist/node_modules/uint8array-extras/index.d.ts +312 -0
- dist/node_modules/uint8array-extras/index.js +321 -0
- dist/node_modules/uint8array-extras/license +9 -0
- dist/node_modules/uint8array-extras/package.json +54 -0
- dist/node_modules/uint8array-extras/readme.md +301 -0
- dist/node_modules/ws/LICENSE +20 -0
- dist/node_modules/ws/README.md +548 -0
- dist/node_modules/ws/browser.js +8 -0
- dist/node_modules/ws/index.js +13 -0
- dist/node_modules/ws/lib/buffer-util.js +131 -0
- dist/node_modules/ws/lib/constants.js +18 -0
- dist/node_modules/ws/lib/event-target.js +292 -0
- dist/node_modules/ws/lib/extension.js +203 -0
- dist/node_modules/ws/lib/limiter.js +55 -0
- dist/node_modules/ws/lib/permessage-deflate.js +528 -0
- dist/node_modules/ws/lib/receiver.js +706 -0
- dist/node_modules/ws/lib/sender.js +602 -0
- dist/node_modules/ws/lib/stream.js +161 -0
- dist/node_modules/ws/lib/subprotocol.js +62 -0
- dist/node_modules/ws/lib/validation.js +152 -0
- dist/node_modules/ws/lib/websocket-server.js +550 -0
- dist/node_modules/ws/lib/websocket.js +1388 -0
- dist/node_modules/ws/package.json +69 -0
- dist/node_modules/ws/wrapper.mjs +8 -0
- dist/package.json +1 -0
- dist/webui/assets/index-B9vGhdCO.js +256 -0
- dist/webui/assets/index-DaqFU7JR.css +1 -0
- dist/webui/index.html +13 -0
- dist/webui/logo.jpg +0 -0
- dist//344/275/277/347/224/250/350/257/264/346/230/216.txt +11 -0
- dist//346/233/264/346/226/260/346/227/245/345/277/227.txt +399 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright © 2025 Borewit
|
|
4
|
+
|
|
5
|
+
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:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
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.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
[](https://github.com/Borewit/text-codec/actions/workflows/ci.yml)
|
|
2
|
+
[](https://www.npmjs.com/package/@borewit/text-codec)
|
|
3
|
+
[](https://npmcharts.com/compare/@borewit/text-codec?interval=30)
|
|
4
|
+

|
|
5
|
+
[](LICENSE.txt)
|
|
6
|
+
|
|
7
|
+
# `@borewit/text-codec`
|
|
8
|
+
|
|
9
|
+
A **lightweight text encoding/decoding polyfill** for JavaScript engines (like [Hermes](https://hermesengine.dev/)) which lack support for certain `TextEncoder` / `TextDecoder` encoding types.
|
|
10
|
+
|
|
11
|
+
This module implements manual encoding and decoding for the most commonly used encodings, without pulling in large dependencies or experimental features.
|
|
12
|
+
|
|
13
|
+
## ✨ Features
|
|
14
|
+
|
|
15
|
+
### Supported encodings:
|
|
16
|
+
- `utf-8` / `utf8`
|
|
17
|
+
- `utf-16le`
|
|
18
|
+
- `ascii`
|
|
19
|
+
- `latin1` / `iso-8859-1`
|
|
20
|
+
- `windows-1252`
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 📦 Installation
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
npm install @borewit/text-codec
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# 📚 API Documentation
|
|
32
|
+
|
|
33
|
+
## `textDecode(bytes, encoding): string`
|
|
34
|
+
|
|
35
|
+
Decodes binary data into a JavaScript string using the specified encoding.
|
|
36
|
+
|
|
37
|
+
**Parameters**
|
|
38
|
+
- `bytes` (`Uint8Array`) — The binary data to decode.
|
|
39
|
+
- `encoding` (`SupportedEncoding`, optional) — Encoding type. Defaults to `"utf-8"`.
|
|
40
|
+
|
|
41
|
+
**Returns**
|
|
42
|
+
- `string` — The decoded text.
|
|
43
|
+
|
|
44
|
+
**Example**
|
|
45
|
+
```js
|
|
46
|
+
import { textDecode } from "@borewit/text-encode";
|
|
47
|
+
|
|
48
|
+
const bytes = new Uint8Array([0x48, 0x65, 0x6c, 0x6c, 0x6f]);
|
|
49
|
+
const text = textDecode(bytes, "ascii");
|
|
50
|
+
console.log(text); // "Hello"
|
|
51
|
+
```
|
|
52
|
+
Encodes a JavaScript string into binary form using the specified encoding.
|
|
53
|
+
|
|
54
|
+
## `textEncode(input, encoding): Uint8Array`
|
|
55
|
+
|
|
56
|
+
**Parameters**
|
|
57
|
+
|
|
58
|
+
- `input` (`string`) — The string to encode.
|
|
59
|
+
- `encoding` (`SupportedEncoding`, optional) — Encoding type. Defaults to `"utf-8"`.
|
|
60
|
+
|
|
61
|
+
**Returns**
|
|
62
|
+
|
|
63
|
+
`Uint8Array` — The encoded binary data.
|
|
64
|
+
|
|
65
|
+
Example:
|
|
66
|
+
```js
|
|
67
|
+
import { textEncode } from "@borewit/text-encode";
|
|
68
|
+
|
|
69
|
+
const bytes = textEncode("Hello", "utf-16le");
|
|
70
|
+
console.log(bytes); // Uint8Array([...])
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## 📜 Licence
|
|
74
|
+
|
|
75
|
+
This project is licensed under the [MIT License](LICENSE.txt). Feel free to use, modify, and distribute as needed.
|
|
76
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type SupportedEncoding = "utf-8" | "utf8" | "utf-16le" | "ascii" | "latin1" | "iso-8859-1" | "windows-1252";
|
|
2
|
+
/**
|
|
3
|
+
* Decode text from binary data
|
|
4
|
+
* @param bytes Binary data
|
|
5
|
+
* @param encoding Encoding
|
|
6
|
+
*/
|
|
7
|
+
export declare function textDecode(bytes: Uint8Array, encoding?: SupportedEncoding): string;
|
|
8
|
+
export declare function textEncode(input?: string, encoding?: SupportedEncoding): Uint8Array;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// text-polyfill.ts
|
|
2
|
+
// Minimal encode/decode for utf-8, utf-16le, ascii, latin1, windows-1252
|
|
3
|
+
const WINDOWS_1252_EXTRA = {
|
|
4
|
+
0x80: "€", 0x82: "‚", 0x83: "ƒ", 0x84: "„", 0x85: "…", 0x86: "†",
|
|
5
|
+
0x87: "‡", 0x88: "ˆ", 0x89: "‰", 0x8a: "Š", 0x8b: "‹", 0x8c: "Œ",
|
|
6
|
+
0x8e: "Ž", 0x91: "‘", 0x92: "’", 0x93: "“", 0x94: "”", 0x95: "•",
|
|
7
|
+
0x96: "–", 0x97: "—", 0x98: "˜", 0x99: "™", 0x9a: "š", 0x9b: "›",
|
|
8
|
+
0x9c: "œ", 0x9e: "ž", 0x9f: "Ÿ",
|
|
9
|
+
};
|
|
10
|
+
const WINDOWS_1252_REVERSE = {};
|
|
11
|
+
for (const [code, char] of Object.entries(WINDOWS_1252_EXTRA)) {
|
|
12
|
+
WINDOWS_1252_REVERSE[char] = Number.parseInt(code);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Decode text from binary data
|
|
16
|
+
* @param bytes Binary data
|
|
17
|
+
* @param encoding Encoding
|
|
18
|
+
*/
|
|
19
|
+
export function textDecode(bytes, encoding = "utf-8") {
|
|
20
|
+
switch (encoding.toLowerCase()) {
|
|
21
|
+
case "utf-8":
|
|
22
|
+
case "utf8":
|
|
23
|
+
if (typeof globalThis.TextDecoder !== "undefined") {
|
|
24
|
+
return new globalThis.TextDecoder("utf-8").decode(bytes);
|
|
25
|
+
}
|
|
26
|
+
return decodeUTF8(bytes);
|
|
27
|
+
case "utf-16le":
|
|
28
|
+
return decodeUTF16LE(bytes);
|
|
29
|
+
case "ascii":
|
|
30
|
+
return decodeASCII(bytes);
|
|
31
|
+
case "latin1":
|
|
32
|
+
case "iso-8859-1":
|
|
33
|
+
return decodeLatin1(bytes);
|
|
34
|
+
case "windows-1252":
|
|
35
|
+
return decodeWindows1252(bytes);
|
|
36
|
+
default:
|
|
37
|
+
throw new RangeError(`Encoding '${encoding}' not supported`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export function textEncode(input = "", encoding = "utf-8") {
|
|
41
|
+
switch (encoding.toLowerCase()) {
|
|
42
|
+
case "utf-8":
|
|
43
|
+
case "utf8":
|
|
44
|
+
if (typeof globalThis.TextEncoder !== "undefined") {
|
|
45
|
+
return new globalThis.TextEncoder().encode(input);
|
|
46
|
+
}
|
|
47
|
+
return encodeUTF8(input);
|
|
48
|
+
case "utf-16le":
|
|
49
|
+
return encodeUTF16LE(input);
|
|
50
|
+
case "ascii":
|
|
51
|
+
return encodeASCII(input);
|
|
52
|
+
case "latin1":
|
|
53
|
+
case "iso-8859-1":
|
|
54
|
+
return encodeLatin1(input);
|
|
55
|
+
case "windows-1252":
|
|
56
|
+
return encodeWindows1252(input);
|
|
57
|
+
default:
|
|
58
|
+
throw new RangeError(`Encoding '${encoding}' not supported`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// --- Internal helpers ---
|
|
62
|
+
function decodeUTF8(bytes) {
|
|
63
|
+
let out = "";
|
|
64
|
+
let i = 0;
|
|
65
|
+
while (i < bytes.length) {
|
|
66
|
+
const b1 = bytes[i++];
|
|
67
|
+
if (b1 < 0x80) {
|
|
68
|
+
out += String.fromCharCode(b1);
|
|
69
|
+
}
|
|
70
|
+
else if (b1 < 0xe0) {
|
|
71
|
+
const b2 = bytes[i++] & 0x3f;
|
|
72
|
+
out += String.fromCharCode(((b1 & 0x1f) << 6) | b2);
|
|
73
|
+
}
|
|
74
|
+
else if (b1 < 0xf0) {
|
|
75
|
+
const b2 = bytes[i++] & 0x3f;
|
|
76
|
+
const b3 = bytes[i++] & 0x3f;
|
|
77
|
+
out += String.fromCharCode(((b1 & 0x0f) << 12) | (b2 << 6) | b3);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
const b2 = bytes[i++] & 0x3f;
|
|
81
|
+
const b3 = bytes[i++] & 0x3f;
|
|
82
|
+
const b4 = bytes[i++] & 0x3f;
|
|
83
|
+
let cp = ((b1 & 0x07) << 18) |
|
|
84
|
+
(b2 << 12) |
|
|
85
|
+
(b3 << 6) |
|
|
86
|
+
b4;
|
|
87
|
+
cp -= 0x10000;
|
|
88
|
+
out += String.fromCharCode(0xd800 + ((cp >> 10) & 0x3ff), 0xdc00 + (cp & 0x3ff));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
function decodeUTF16LE(bytes) {
|
|
94
|
+
let out = "";
|
|
95
|
+
for (let i = 0; i < bytes.length; i += 2) {
|
|
96
|
+
out += String.fromCharCode(bytes[i] | (bytes[i + 1] << 8));
|
|
97
|
+
}
|
|
98
|
+
return out;
|
|
99
|
+
}
|
|
100
|
+
function decodeASCII(bytes) {
|
|
101
|
+
return String.fromCharCode(...bytes.map((b) => b & 0x7f));
|
|
102
|
+
}
|
|
103
|
+
function decodeLatin1(bytes) {
|
|
104
|
+
return String.fromCharCode(...bytes);
|
|
105
|
+
}
|
|
106
|
+
function decodeWindows1252(bytes) {
|
|
107
|
+
let out = "";
|
|
108
|
+
for (const b of bytes) {
|
|
109
|
+
if (b >= 0x80 && b <= 0x9f && WINDOWS_1252_EXTRA[b]) {
|
|
110
|
+
out += WINDOWS_1252_EXTRA[b];
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
out += String.fromCharCode(b);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return out;
|
|
117
|
+
}
|
|
118
|
+
function encodeUTF8(str) {
|
|
119
|
+
const out = [];
|
|
120
|
+
for (let i = 0; i < str.length; i++) {
|
|
121
|
+
const cp = str.charCodeAt(i);
|
|
122
|
+
if (cp < 0x80) {
|
|
123
|
+
out.push(cp);
|
|
124
|
+
}
|
|
125
|
+
else if (cp < 0x800) {
|
|
126
|
+
out.push(0xc0 | (cp >> 6), 0x80 | (cp & 0x3f));
|
|
127
|
+
}
|
|
128
|
+
else if (cp < 0x10000) {
|
|
129
|
+
out.push(0xe0 | (cp >> 12), 0x80 | ((cp >> 6) & 0x3f), 0x80 | (cp & 0x3f));
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
out.push(0xf0 | (cp >> 18), 0x80 | ((cp >> 12) & 0x3f), 0x80 | ((cp >> 6) & 0x3f), 0x80 | (cp & 0x3f));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return new Uint8Array(out);
|
|
136
|
+
}
|
|
137
|
+
function encodeUTF16LE(str) {
|
|
138
|
+
const out = new Uint8Array(str.length * 2);
|
|
139
|
+
for (let i = 0; i < str.length; i++) {
|
|
140
|
+
const code = str.charCodeAt(i);
|
|
141
|
+
out[i * 2] = code & 0xff;
|
|
142
|
+
out[i * 2 + 1] = code >> 8;
|
|
143
|
+
}
|
|
144
|
+
return out;
|
|
145
|
+
}
|
|
146
|
+
function encodeASCII(str) {
|
|
147
|
+
return new Uint8Array([...str].map((ch) => ch.charCodeAt(0) & 0x7f));
|
|
148
|
+
}
|
|
149
|
+
function encodeLatin1(str) {
|
|
150
|
+
return new Uint8Array([...str].map((ch) => ch.charCodeAt(0) & 0xff));
|
|
151
|
+
}
|
|
152
|
+
function encodeWindows1252(str) {
|
|
153
|
+
return new Uint8Array([...str].map((ch) => {
|
|
154
|
+
const code = ch.charCodeAt(0);
|
|
155
|
+
if (code <= 0xff)
|
|
156
|
+
return code;
|
|
157
|
+
if (WINDOWS_1252_REVERSE[ch] !== undefined)
|
|
158
|
+
return WINDOWS_1252_REVERSE[ch];
|
|
159
|
+
return 0x3f; // '?'
|
|
160
|
+
}));
|
|
161
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@borewit/text-codec",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Text Decoder",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": "./lib/index.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"lib/index.js",
|
|
10
|
+
"lib/index.d.ts"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"clean": "del-cli lib/**/*.js lib/***.js.map test/**/*.d.ts test/**/*.js test/**/*.js.map",
|
|
14
|
+
"build": "npm run compile",
|
|
15
|
+
"compile:src": "tsc --p lib --sourceMap false",
|
|
16
|
+
"compile:test": "tsc --p test",
|
|
17
|
+
"compile": "npm run compile:src && npm run compile:test",
|
|
18
|
+
"lint": "biome check",
|
|
19
|
+
"test": "mocha",
|
|
20
|
+
"update-biome": "npm install --save-dev --save-exact @biomejs/biome && npx @biomejs/biome migrate --write"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@biomejs/biome": "2.1.4",
|
|
24
|
+
"@types/chai": "^5.2.2",
|
|
25
|
+
"@types/mocha": "^10.0.10",
|
|
26
|
+
"chai": "^5.2.1",
|
|
27
|
+
"mocha": "^11.7.1",
|
|
28
|
+
"ts-node": "^10.9.2",
|
|
29
|
+
"typescript": "^5.9.2"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"TextDecoder",
|
|
33
|
+
"TextEncoder",
|
|
34
|
+
"decoder",
|
|
35
|
+
"decoding",
|
|
36
|
+
"encod",
|
|
37
|
+
"encoding",
|
|
38
|
+
"decode",
|
|
39
|
+
"text",
|
|
40
|
+
"ascii",
|
|
41
|
+
"utf-8",
|
|
42
|
+
"utf8",
|
|
43
|
+
"utf-16le",
|
|
44
|
+
"latin1",
|
|
45
|
+
"iso-8859-1",
|
|
46
|
+
"windows-1252",
|
|
47
|
+
"charset",
|
|
48
|
+
"encoding",
|
|
49
|
+
"decoding",
|
|
50
|
+
"polyfill",
|
|
51
|
+
"character-set",
|
|
52
|
+
"latin",
|
|
53
|
+
"hermes"
|
|
54
|
+
],
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "https://github.com/Borewit/text-codec"
|
|
58
|
+
},
|
|
59
|
+
"author": {
|
|
60
|
+
"name": "Borewit",
|
|
61
|
+
"url": "https://github.com/Borewit"
|
|
62
|
+
},
|
|
63
|
+
"funding": {
|
|
64
|
+
"type": "github",
|
|
65
|
+
"url": "https://github.com/sponsors/Borewit"
|
|
66
|
+
},
|
|
67
|
+
"license": "MIT"
|
|
68
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
MIT license
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2017 sql.js authors (see AUTHORS)
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# Some portions of the Makefile taken from:
|
|
27
|
+
Copyright 2017 Ryusei Yamaguchi
|
|
28
|
+
|
|
29
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
30
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
31
|
+
the Software without restriction, including without limitation the rights to
|
|
32
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
33
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
34
|
+
subject to the following conditions:
|
|
35
|
+
|
|
36
|
+
The above copyright notice and this permission notice shall be included in all
|
|
37
|
+
copies or substantial portions of the Software.
|
|
38
|
+
|
|
39
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
40
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
41
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
42
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
43
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
44
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|