js-dev-tool 1.2.16 → 1.2.20
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.
- package/README.md +44 -13
- package/common/index.d.ts +53 -1
- package/common/index.js +67 -0
- package/extras/gzip-tool.d.ts +34 -0
- package/extras/gzip-tool.js +65 -0
- package/package.json +7 -5
- package/extras/cc-map.d.ts +0 -141
- package/extras/cc-map.js +0 -140
package/README.md
CHANGED
|
@@ -30,11 +30,11 @@ This section reflects the current `package.json#exports` and `package.json#files
|
|
|
30
30
|
| --- | --- |
|
|
31
31
|
| `js-dev-tool` | Root namespace object with `{ progress, common, utils }` |
|
|
32
32
|
| `js-dev-tool/utils` | File, JSON, CLI, TSV/CSV, and small utility helpers |
|
|
33
|
-
| `js-dev-tool/common` | File-system
|
|
33
|
+
| `js-dev-tool/common` | File-system helpers, terminal rendering primitives, and `isMain` |
|
|
34
34
|
| `js-dev-tool/progress` | Progress renderer, spinner helpers, webpack / browserify progress hooks |
|
|
35
35
|
| `js-dev-tool/progress/progress-extras` | Environment and webpack-version helpers |
|
|
36
36
|
| `js-dev-tool/extras/algorithms` | Binary-search helper |
|
|
37
|
-
| `js-dev-tool/extras/
|
|
37
|
+
| `js-dev-tool/extras/gzip-tool` | Deterministic gzip + Base64 source-literal helpers |
|
|
38
38
|
| `js-dev-tool/extras/jsonl` | JSONL readers, JSONL-to-array/map helpers, and `jsonMinify` |
|
|
39
39
|
| `js-dev-tool/extras/json-minify` | `jsonMinify` |
|
|
40
40
|
| `js-dev-tool/extras/progress-light` | Small fixed-frame spinner |
|
|
@@ -94,6 +94,20 @@ console.log(map["1"], deps.slice(0, 5));
|
|
|
94
94
|
- `createLogStreamAndResolvePath(logPath)`
|
|
95
95
|
- `renderLine(msg?, row?)`
|
|
96
96
|
- `cursor(enabled, output?)`
|
|
97
|
+
- `isMain(moduleOrPathOrMeta)`
|
|
98
|
+
|
|
99
|
+
`isMain(...)` is the cross-module-system entry-point check. It accepts:
|
|
100
|
+
|
|
101
|
+
- CommonJS: `module` or `__filename`
|
|
102
|
+
- ESM: `import.meta` or `fileURLToPath(import.meta.url)`
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
const { isMain } = require("js-dev-tool/common");
|
|
106
|
+
|
|
107
|
+
if (isMain(module)) {
|
|
108
|
+
console.log("run only when executed directly");
|
|
109
|
+
}
|
|
110
|
+
```
|
|
97
111
|
|
|
98
112
|
## `progress`
|
|
99
113
|
|
|
@@ -133,17 +147,6 @@ const index = bnSearch(values, 7, (left, right) => left - right);
|
|
|
133
147
|
console.log(index); // 2
|
|
134
148
|
```
|
|
135
149
|
|
|
136
|
-
### `js-dev-tool/extras/cc-map`
|
|
137
|
-
|
|
138
|
-
Exports a character-code map object. It is most useful when you want named constants for ASCII / control-character comparisons.
|
|
139
|
-
|
|
140
|
-
```js
|
|
141
|
-
const CC_MAP = require("js-dev-tool/extras/cc-map");
|
|
142
|
-
|
|
143
|
-
console.log(CC_MAP.LF); // 10
|
|
144
|
-
console.log(CC_MAP.DOUBLE_QUOTE); // 34
|
|
145
|
-
```
|
|
146
|
-
|
|
147
150
|
### `js-dev-tool/extras/jsonl`
|
|
148
151
|
|
|
149
152
|
Exports:
|
|
@@ -202,6 +205,34 @@ async function main() {
|
|
|
202
205
|
main().catch(console.error);
|
|
203
206
|
```
|
|
204
207
|
|
|
208
|
+
### `js-dev-tool/extras/gzip-tool`
|
|
209
|
+
|
|
210
|
+
Exports:
|
|
211
|
+
|
|
212
|
+
- `gzip(data, useZeroTimestamp?)`
|
|
213
|
+
- `toBase64SourceLiteral(rawData, wrapSize?)`
|
|
214
|
+
|
|
215
|
+
Use this module when you want deterministic gzip output and a clean way to embed the compressed bytes into JavaScript source.
|
|
216
|
+
|
|
217
|
+
Key behaviors:
|
|
218
|
+
|
|
219
|
+
- `gzip(...)` compresses with gzip level `9`
|
|
220
|
+
- `gzip(..., true)` zeroes the gzip `mtime` header so repeated builds with the same input stay byte-stable
|
|
221
|
+
- `toBase64SourceLiteral(...)` wraps Base64 output with trailing `\` line continuations so the result can be pasted into a multi-line JavaScript string literal
|
|
222
|
+
- `wrapSize` must be a finite integer between `1` and `2048`
|
|
223
|
+
|
|
224
|
+
Example:
|
|
225
|
+
|
|
226
|
+
```js
|
|
227
|
+
const { gzip, toBase64SourceLiteral } = require("js-dev-tool/extras/gzip-tool");
|
|
228
|
+
|
|
229
|
+
const compressed = gzip("console.log(\"hello\");");
|
|
230
|
+
const sourceLiteral = toBase64SourceLiteral(compressed, 76);
|
|
231
|
+
|
|
232
|
+
console.log(compressed.length);
|
|
233
|
+
console.log(sourceLiteral);
|
|
234
|
+
```
|
|
235
|
+
|
|
205
236
|
### `js-dev-tool/extras/progress-light`
|
|
206
237
|
|
|
207
238
|
Exports:
|
package/common/index.d.ts
CHANGED
|
@@ -41,4 +41,56 @@ export function renderLine(msg?: string, row?: number): void;
|
|
|
41
41
|
* @param {boolean} enabled
|
|
42
42
|
* @param {NodeJS.WriteStream} [output]
|
|
43
43
|
*/
|
|
44
|
-
export function cursor(enabled: boolean, output?: NodeJS.WriteStream): void;
|
|
44
|
+
export function cursor(enabled: boolean, output?: NodeJS.WriteStream): void;
|
|
45
|
+
/**
|
|
46
|
+
* Minimal `import.meta`-compatible shape accepted by `isMain`.
|
|
47
|
+
*
|
|
48
|
+
* Only `url` is required. `resolve` stays optional so the same shape works
|
|
49
|
+
* across older and newer Node.js ESM runtimes.
|
|
50
|
+
*/
|
|
51
|
+
declare type TImportMeta = {
|
|
52
|
+
url: string;
|
|
53
|
+
resolve?: (filePath: string) => string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Returns `true` when the provided CommonJS module, absolute file path, or
|
|
57
|
+
* ESM `import.meta` object represents the current process entry point.
|
|
58
|
+
*
|
|
59
|
+
* This gives one API that works across both module systems:
|
|
60
|
+
* - CommonJS: `module` or `__filename`
|
|
61
|
+
* - ESM: `import.meta` or `fileURLToPath(import.meta.url)`
|
|
62
|
+
*
|
|
63
|
+
* Equivalent to `import.meta.main` in Deno / Bun,
|
|
64
|
+
* or `process.argv[1] === fileURLToPath(import.meta.url)` in ESM.
|
|
65
|
+
*
|
|
66
|
+
* @param {Partial<NodeJS.Module> | TImportMeta | string} modOrPathOrMeta
|
|
67
|
+
* Pass `module` or `__filename` from CommonJS,
|
|
68
|
+
* or `import.meta` / `fileURLToPath(import.meta.url)` from ESM.
|
|
69
|
+
* @returns {boolean} `true` if the calling module is the entry point.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* // CommonJS — via module object:
|
|
73
|
+
* const { isMain } = require("js-dev-tool/common");
|
|
74
|
+
* if (isMain(module)) { main(); }
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* // CommonJS — via __filename:
|
|
78
|
+
* const { isMain } = require("js-dev-tool/common");
|
|
79
|
+
* if (isMain(__filename)) { main(); }
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* // ESM — via import.meta object:
|
|
83
|
+
* import { isMain } from "js-dev-tool/common";
|
|
84
|
+
* if (isMain(import.meta)) { main(); }
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* // ESM — via fileURLToPath(import.meta.url):
|
|
88
|
+
* import { isMain } from "js-dev-tool/common";
|
|
89
|
+
* import { fileURLToPath } from "node:url";
|
|
90
|
+
* if (isMain(fileURLToPath(import.meta.url))) { main(); }
|
|
91
|
+
*
|
|
92
|
+
* @since Node.js v0.1.16
|
|
93
|
+
* @verified CJS: Confirmed working on Node.js v11.15.0 — v26.3.0.
|
|
94
|
+
* @verified ESM: Confirmed working on Node.js v12.22.11 — v26.3.0.
|
|
95
|
+
*/
|
|
96
|
+
export function isMain(modOrPathOrMeta: Partial<NodeJS.Module> | TImportMeta | string): boolean;
|
package/common/index.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
const fs = require("fs");
|
|
14
14
|
const path = require("path");
|
|
15
15
|
const rl = require("readline");
|
|
16
|
+
const { fileURLToPath } = require("url");
|
|
16
17
|
/**
|
|
17
18
|
* @param {string} dest
|
|
18
19
|
*/
|
|
@@ -55,9 +56,75 @@ const cursor = (enabled, output = process.stderr) => {
|
|
|
55
56
|
output.write("\x1B[?25l");
|
|
56
57
|
}
|
|
57
58
|
};
|
|
59
|
+
/**
|
|
60
|
+
* Minimal `import.meta`-compatible shape accepted by {@link isMain}.
|
|
61
|
+
*
|
|
62
|
+
* Only `url` is required. `resolve` stays optional so the same shape works
|
|
63
|
+
* across older and newer Node.js ESM runtimes.
|
|
64
|
+
*
|
|
65
|
+
* @typedef {{
|
|
66
|
+
* url: string;
|
|
67
|
+
* resolve?: (filePath: string) => string;
|
|
68
|
+
* }} TImportMeta
|
|
69
|
+
*/
|
|
70
|
+
/**
|
|
71
|
+
* Returns `true` when the provided CommonJS module, absolute file path, or
|
|
72
|
+
* ESM `import.meta` object represents the current process entry point.
|
|
73
|
+
*
|
|
74
|
+
* This gives one API that works across both module systems:
|
|
75
|
+
* - CommonJS: `module` or `__filename`
|
|
76
|
+
* - ESM: `import.meta` or `fileURLToPath(import.meta.url)`
|
|
77
|
+
*
|
|
78
|
+
* Equivalent to `import.meta.main` in Deno / Bun,
|
|
79
|
+
* or `process.argv[1] === fileURLToPath(import.meta.url)` in ESM.
|
|
80
|
+
*
|
|
81
|
+
* @param {Partial<NodeJS.Module> | TImportMeta | string} modOrPathOrMeta
|
|
82
|
+
* Pass `module` or `__filename` from CommonJS,
|
|
83
|
+
* or `import.meta` / `fileURLToPath(import.meta.url)` from ESM.
|
|
84
|
+
* @returns {boolean} `true` if the calling module is the entry point.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* // CommonJS — via module object:
|
|
88
|
+
* const { isMain } = require("js-dev-tool/common");
|
|
89
|
+
* if (isMain(module)) { main(); }
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* // CommonJS — via __filename:
|
|
93
|
+
* const { isMain } = require("js-dev-tool/common");
|
|
94
|
+
* if (isMain(__filename)) { main(); }
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* // ESM — via import.meta object:
|
|
98
|
+
* import { isMain } from "js-dev-tool/common";
|
|
99
|
+
* if (isMain(import.meta)) { main(); }
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* // ESM — via fileURLToPath(import.meta.url):
|
|
103
|
+
* import { isMain } from "js-dev-tool/common";
|
|
104
|
+
* import { fileURLToPath } from "node:url";
|
|
105
|
+
* if (isMain(fileURLToPath(import.meta.url))) { main(); }
|
|
106
|
+
*
|
|
107
|
+
* @since Node.js v0.1.16
|
|
108
|
+
* @verified CJS: Confirmed working on Node.js v11.15.0 — v26.3.0.
|
|
109
|
+
* @verified ESM: Confirmed working on Node.js v12.22.11 — v26.3.0.
|
|
110
|
+
*/
|
|
111
|
+
function isMain(modOrPathOrMeta) {
|
|
112
|
+
/** @type {string=} */
|
|
113
|
+
let pathString;
|
|
114
|
+
if (typeof modOrPathOrMeta === "string") {
|
|
115
|
+
pathString = modOrPathOrMeta;
|
|
116
|
+
} else if ("url" in modOrPathOrMeta /* && "resolve" in modOrPathOrMeta */) {
|
|
117
|
+
pathString = fileURLToPath(modOrPathOrMeta.url);
|
|
118
|
+
}
|
|
119
|
+
if (pathString) {
|
|
120
|
+
return process.argv[1] === pathString;
|
|
121
|
+
}
|
|
122
|
+
return require.main === modOrPathOrMeta;
|
|
123
|
+
}
|
|
58
124
|
module.exports = {
|
|
59
125
|
checkParentDirectory,
|
|
60
126
|
createLogStreamAndResolvePath,
|
|
61
127
|
renderLine,
|
|
62
128
|
cursor,
|
|
129
|
+
isMain,
|
|
63
130
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
3
|
+
// Copyright (C) 2026 jeffy-g <hirotom1107@gmail.com>
|
|
4
|
+
// Released under the MIT license
|
|
5
|
+
// https://opensource.org/licenses/mit-license.php
|
|
6
|
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @file extras/gzip-tool.d.ts
|
|
10
|
+
*/
|
|
11
|
+
import type { InputType } from "zlib";
|
|
12
|
+
/**
|
|
13
|
+
* Compresses input data as gzip and optionally normalizes the header timestamp.
|
|
14
|
+
*
|
|
15
|
+
* The compressed output is produced with level 9 and the default zlib strategy.
|
|
16
|
+
* When `useZeroTimestamp` is enabled, the gzip `mtime` header is overwritten with `0`
|
|
17
|
+
* so repeated runs with the same input produce stable binary output.
|
|
18
|
+
*
|
|
19
|
+
* @param {InputType} data raw data to compress
|
|
20
|
+
* @param {boolean=} [useZeroTimestamp=true] when `true`, zeroes the gzip `mtime` header. (default __`true`__)
|
|
21
|
+
* @returns {Buffer} gzip-compressed binary data
|
|
22
|
+
*/
|
|
23
|
+
export function gzip(data: InputType, useZeroTimestamp?: boolean): Buffer;
|
|
24
|
+
/**
|
|
25
|
+
* Encodes binary data as Base64 and formats it as a JavaScript string-literal fragment.
|
|
26
|
+
*
|
|
27
|
+
* Each wrapped line ends with a trailing backslash so the returned text can be pasted
|
|
28
|
+
* directly into source code as a multi-line continued string literal.
|
|
29
|
+
*
|
|
30
|
+
* @param {Uint8Array} rawData raw bytes to encode
|
|
31
|
+
* @param {number=} [wrapSize=100] max Base64 characters per physical line. (default __`100`__)
|
|
32
|
+
* @returns {string} Base64 text wrapped with `\\\n` line continuations
|
|
33
|
+
*/
|
|
34
|
+
export function toBase64SourceLiteral(rawData: Uint8Array, wrapSize?: number): string;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
3
|
+
// Copyright (C) 2026 jeffy-g <hirotom1107@gmail.com>
|
|
4
|
+
// Released under the MIT license
|
|
5
|
+
// https://opensource.org/licenses/mit-license.php
|
|
6
|
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
7
|
+
*/
|
|
8
|
+
"use strict";
|
|
9
|
+
/**
|
|
10
|
+
* @file extras/gzip-tool.js
|
|
11
|
+
*/
|
|
12
|
+
const { gzipSync, constants } = require("zlib");
|
|
13
|
+
/**
|
|
14
|
+
* @import { InputType } from "zlib";
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Compresses input data as gzip and optionally normalizes the header timestamp.
|
|
18
|
+
*
|
|
19
|
+
* The compressed output is produced with level 9 and the default zlib strategy.
|
|
20
|
+
* When `useZeroTimestamp` is enabled, the gzip `mtime` header is overwritten with `0`
|
|
21
|
+
* so repeated runs with the same input produce stable binary output.
|
|
22
|
+
*
|
|
23
|
+
* @param {InputType} data raw data to compress
|
|
24
|
+
* @param {boolean=} [useZeroTimestamp=true] when `true`, zeroes the gzip `mtime` header. (default __`true`__)
|
|
25
|
+
* @returns {Buffer} gzip-compressed binary data
|
|
26
|
+
*/
|
|
27
|
+
function gzip(data, useZeroTimestamp = true) {
|
|
28
|
+
const compressed = gzipSync(data, {
|
|
29
|
+
level: 9, strategy: constants.Z_DEFAULT_STRATEGY
|
|
30
|
+
});
|
|
31
|
+
if (useZeroTimestamp) {
|
|
32
|
+
compressed.writeUInt32LE(0, 4);
|
|
33
|
+
}
|
|
34
|
+
return compressed;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Encodes binary data as Base64 and formats it as a JavaScript string-literal fragment.
|
|
38
|
+
*
|
|
39
|
+
* Each wrapped line ends with a trailing backslash so the returned text can be pasted
|
|
40
|
+
* directly into source code as a multi-line continued string literal.
|
|
41
|
+
*
|
|
42
|
+
* @param {Uint8Array} rawData raw bytes to encode
|
|
43
|
+
* @param {number=} [wrapSize=100] max Base64 characters per physical line. (default __`100`__)
|
|
44
|
+
* @returns {string} Base64 text wrapped with `\\\n` line continuations
|
|
45
|
+
*/
|
|
46
|
+
function toBase64SourceLiteral(rawData, wrapSize = 100) {
|
|
47
|
+
if (!Number.isFinite(wrapSize)) throw new Error(`Invalid wrapSize: ${wrapSize}`);
|
|
48
|
+
if (!Number.isInteger(wrapSize)) throw new Error(`wrapSize is not a integer - ${wrapSize}`);
|
|
49
|
+
if (wrapSize > 2048) throw new Error(`"wrapSize" is expected to be 2048 or less - ${wrapSize}`);
|
|
50
|
+
if (wrapSize < 1) throw new Error(`A wrapSize of 0 or less will result in an infinite loop, so please make it 1 or greater. - ${wrapSize}`);
|
|
51
|
+
const base64 = Buffer.from(rawData).toString("base64");
|
|
52
|
+
const L = base64.length;
|
|
53
|
+
if (!L) return "";
|
|
54
|
+
let wrapped = "", lineSuffix = "\\\n";
|
|
55
|
+
for (let offset = 0; offset < L;) {
|
|
56
|
+
if (
|
|
57
|
+
(offset + wrapSize) >= L
|
|
58
|
+
) lineSuffix = "";
|
|
59
|
+
wrapped += (base64.slice(offset, offset += wrapSize) + lineSuffix);
|
|
60
|
+
}
|
|
61
|
+
return wrapped;
|
|
62
|
+
}
|
|
63
|
+
module.exports = {
|
|
64
|
+
gzip, toBase64SourceLiteral
|
|
65
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "js-dev-tool",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.20",
|
|
4
|
+
"type": "commonjs",
|
|
4
5
|
"bin": {
|
|
5
6
|
"jstool": "tools.js",
|
|
6
7
|
"tgl-jsonl": "extras/toggle-jsonl.js"
|
|
@@ -74,6 +75,7 @@
|
|
|
74
75
|
"!scripts/bin",
|
|
75
76
|
"!publish-version.json",
|
|
76
77
|
"!scripts/*.mjs",
|
|
78
|
+
"!scripts/smoke",
|
|
77
79
|
"!regex-test.ts",
|
|
78
80
|
"!extras/npm",
|
|
79
81
|
"!/**/*.png",
|
|
@@ -82,18 +84,18 @@
|
|
|
82
84
|
"!tool.sh"
|
|
83
85
|
],
|
|
84
86
|
"peerDependencies": {
|
|
85
|
-
"archiver": "^
|
|
87
|
+
"archiver": "^7.0.1",
|
|
86
88
|
"webpack": "*"
|
|
87
89
|
},
|
|
88
90
|
"dependencies": {
|
|
89
91
|
"colors.ts": "^1.0.20",
|
|
90
|
-
"fflate": "^0.8.
|
|
92
|
+
"fflate": "^0.8.3",
|
|
91
93
|
"literate-regex": "^0.6.11",
|
|
92
94
|
"mini-semaphore": "^1.5.4",
|
|
93
95
|
"replace": "^1.2.2",
|
|
94
96
|
"rm-cstyle-cmts": "^3.4.4",
|
|
95
|
-
"terser": "^5.
|
|
96
|
-
"tin-args": "^0.1.
|
|
97
|
+
"terser": "^5.48.0",
|
|
98
|
+
"tin-args": "^0.1.7",
|
|
97
99
|
"ts-cc-map": "^1.1.0"
|
|
98
100
|
}
|
|
99
101
|
}
|
package/extras/cc-map.d.ts
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
3
|
-
// Copyright (C) 2026 jeffy-g <hirotom1107@gmail.com>
|
|
4
|
-
// Released under the MIT license
|
|
5
|
-
// https://opensource.org/licenses/mit-license.php
|
|
6
|
-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* @file extras/cc-map.d.ts
|
|
10
|
-
*/
|
|
11
|
-
export declare type TCC_MAP = {
|
|
12
|
-
/** `\u0000` */ NULL: 0;
|
|
13
|
-
/** `\u0001` */ SOH: 1;
|
|
14
|
-
/** `\u0002` */ STX: 2;
|
|
15
|
-
/** `\u0003` */ ETX: 3;
|
|
16
|
-
/** `\u0004` */ EOT: 4;
|
|
17
|
-
/** `\u0005` */ ENQ: 5;
|
|
18
|
-
/** `\u0006` */ ACK: 6;
|
|
19
|
-
/** `\u0007` */ BEL: 7;
|
|
20
|
-
/** `\u0008` */ BS: 8;
|
|
21
|
-
/** `\t` */ TAB: 9;
|
|
22
|
-
/** `\n` */ LF: 10;
|
|
23
|
-
/** `\u000b` */ VT: 11;
|
|
24
|
-
/** `\f` */ FF: 12;
|
|
25
|
-
/** `\r` */ CR: 13;
|
|
26
|
-
/** `\u000e` */ SO: 14;
|
|
27
|
-
/** `\u000f` */ SI: 15;
|
|
28
|
-
/** `\u0010` */ DLE: 16;
|
|
29
|
-
/** `\u0011` */ DC1: 17;
|
|
30
|
-
/** `\u0012` */ DC2: 18;
|
|
31
|
-
/** `\u0013` */ DC3: 19;
|
|
32
|
-
/** `\u0014` */ DC4: 20;
|
|
33
|
-
/** `\u0015` */ NAK: 21;
|
|
34
|
-
/** `\u0016` */ SYN: 22;
|
|
35
|
-
/** `\u0017` */ ETB: 23;
|
|
36
|
-
/** `\u0018` */ CAN: 24;
|
|
37
|
-
/** `\u0019` */ EM: 25;
|
|
38
|
-
/** `\u001a` */ SUB: 26;
|
|
39
|
-
/** `\u001b` */ ESC: 27;
|
|
40
|
-
/** `\u001c` */ FS: 28;
|
|
41
|
-
/** `\u001d` */ GS: 29;
|
|
42
|
-
/** `\u001e` */ RS: 30;
|
|
43
|
-
/** `\u001f` */ US: 31;
|
|
44
|
-
/** ` ` */ SPACE: 32;
|
|
45
|
-
/** `!` */ EXCLAMATION: 33;
|
|
46
|
-
/** `"` */ DOUBLE_QUOTE: 34;
|
|
47
|
-
/** `#` */ HASH: 35;
|
|
48
|
-
/** `$` */ DOLLAR: 36;
|
|
49
|
-
/** `%` */ PERCENT: 37;
|
|
50
|
-
/** `&` */ AMPERSAND: 38;
|
|
51
|
-
/** `'` */ SINGLE_QUOTE: 39;
|
|
52
|
-
/** `(` */ LEFT_PAREN: 40;
|
|
53
|
-
/** `)` */ RIGHT_PAREN: 41;
|
|
54
|
-
/** `*` */ ASTERISK: 42;
|
|
55
|
-
/** `+` */ PLUS: 43;
|
|
56
|
-
/** `,` */ COMMA: 44;
|
|
57
|
-
/** `-` */ MINUS: 45;
|
|
58
|
-
/** `.` */ PERIOD: 46;
|
|
59
|
-
/** `/` */ SLASH: 47;
|
|
60
|
-
/** `0` */ ZERO: 48;
|
|
61
|
-
/** `1` */ ONE: 49;
|
|
62
|
-
/** `2` */ TWO: 50;
|
|
63
|
-
/** `3` */ THREE: 51;
|
|
64
|
-
/** `4` */ FOUR: 52;
|
|
65
|
-
/** `5` */ FIVE: 53;
|
|
66
|
-
/** `6` */ SIX: 54;
|
|
67
|
-
/** `7` */ SEVEN: 55;
|
|
68
|
-
/** `8` */ EIGHT: 56;
|
|
69
|
-
/** `9` */ NINE: 57;
|
|
70
|
-
/** `:` */ COLON: 58;
|
|
71
|
-
/** `;` */ SEMICOLON: 59;
|
|
72
|
-
/** `<` */ LESS_THAN: 60;
|
|
73
|
-
/** `=` */ EQUAL: 61;
|
|
74
|
-
/** `>` */ GREATER_THAN: 62;
|
|
75
|
-
/** `?` */ QUESTION: 63;
|
|
76
|
-
/** `@` */ AT: 64;
|
|
77
|
-
/** `A` */ A: 65;
|
|
78
|
-
/** `B` */ B: 66;
|
|
79
|
-
/** `C` */ C: 67;
|
|
80
|
-
/** `D` */ D: 68;
|
|
81
|
-
/** `E` */ E: 69;
|
|
82
|
-
/** `F` */ F: 70;
|
|
83
|
-
/** `G` */ G: 71;
|
|
84
|
-
/** `H` */ H: 72;
|
|
85
|
-
/** `I` */ I: 73;
|
|
86
|
-
/** `J` */ J: 74;
|
|
87
|
-
/** `K` */ K: 75;
|
|
88
|
-
/** `L` */ L: 76;
|
|
89
|
-
/** `M` */ M: 77;
|
|
90
|
-
/** `N` */ N: 78;
|
|
91
|
-
/** `O` */ O: 79;
|
|
92
|
-
/** `P` */ P: 80;
|
|
93
|
-
/** `Q` */ Q: 81;
|
|
94
|
-
/** `R` */ R: 82;
|
|
95
|
-
/** `S` */ S: 83;
|
|
96
|
-
/** `T` */ T: 84;
|
|
97
|
-
/** `U` */ U: 85;
|
|
98
|
-
/** `V` */ V: 86;
|
|
99
|
-
/** `W` */ W: 87;
|
|
100
|
-
/** `X` */ X: 88;
|
|
101
|
-
/** `Y` */ Y: 89;
|
|
102
|
-
/** `Z` */ Z: 90;
|
|
103
|
-
/** `[` */ LEFT_BRACKET: 91;
|
|
104
|
-
/** `\` */ BACKSLASH: 92;
|
|
105
|
-
/** `]` */ RIGHT_BRACKET: 93;
|
|
106
|
-
/** `^` */ CARET: 94;
|
|
107
|
-
/** `_` */ UNDERSCORE: 95;
|
|
108
|
-
/** __`__ */ GRAVE: 96;
|
|
109
|
-
/** `a` */ a: 97;
|
|
110
|
-
/** `b` */ b: 98;
|
|
111
|
-
/** `c` */ c: 99;
|
|
112
|
-
/** `d` */ d: 100;
|
|
113
|
-
/** `e` */ e: 101;
|
|
114
|
-
/** `f` */ f: 102;
|
|
115
|
-
/** `g` */ g: 103;
|
|
116
|
-
/** `h` */ h: 104;
|
|
117
|
-
/** `i` */ i: 105;
|
|
118
|
-
/** `j` */ j: 106;
|
|
119
|
-
/** `k` */ k: 107;
|
|
120
|
-
/** `l` */ l: 108;
|
|
121
|
-
/** `m` */ m: 109;
|
|
122
|
-
/** `n` */ n: 110;
|
|
123
|
-
/** `o` */ o: 111;
|
|
124
|
-
/** `p` */ p: 112;
|
|
125
|
-
/** `q` */ q: 113;
|
|
126
|
-
/** `r` */ r: 114;
|
|
127
|
-
/** `s` */ s: 115;
|
|
128
|
-
/** `t` */ t: 116;
|
|
129
|
-
/** `u` */ u: 117;
|
|
130
|
-
/** `v` */ v: 118;
|
|
131
|
-
/** `w` */ w: 119;
|
|
132
|
-
/** `x` */ x: 120;
|
|
133
|
-
/** `y` */ y: 121;
|
|
134
|
-
/** `z` */ z: 122;
|
|
135
|
-
/** `{` */ LEFT_BRACE: 123;
|
|
136
|
-
/** `|` */ PIPE: 124;
|
|
137
|
-
/** `}` */ RIGHT_BRACE: 125;
|
|
138
|
-
/** `~` */ TILDE: 126;
|
|
139
|
-
};
|
|
140
|
-
declare const CC_MAP: TCC_MAP;
|
|
141
|
-
export = CC_MAP;
|
package/extras/cc-map.js
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
3
|
-
// Copyright (C) 2026 jeffy-g <hirotom1107@gmail.com>
|
|
4
|
-
// Released under the MIT license
|
|
5
|
-
// https://opensource.org/licenses/mit-license.php
|
|
6
|
-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* @file extras/cc-map.js
|
|
10
|
-
* @import { TCC_MAP } from "./cc-map";
|
|
11
|
-
*/
|
|
12
|
-
module.exports = /** @type {TCC_MAP} */({
|
|
13
|
-
/** `\u0000` */ NULL: 0,
|
|
14
|
-
/** `\u0001` */ SOH: 1,
|
|
15
|
-
/** `\u0002` */ STX: 2,
|
|
16
|
-
/** `\u0003` */ ETX: 3,
|
|
17
|
-
/** `\u0004` */ EOT: 4,
|
|
18
|
-
/** `\u0005` */ ENQ: 5,
|
|
19
|
-
/** `\u0006` */ ACK: 6,
|
|
20
|
-
/** `\u0007` */ BEL: 7,
|
|
21
|
-
/** `\u0008` */ BS: 8,
|
|
22
|
-
/** `\t` */ TAB: 9,
|
|
23
|
-
/** `\n` */ LF: 10,
|
|
24
|
-
/** `\u000b` */ VT: 11,
|
|
25
|
-
/** `\f` */ FF: 12,
|
|
26
|
-
/** `\r` */ CR: 13,
|
|
27
|
-
/** `\u000e` */ SO: 14,
|
|
28
|
-
/** `\u000f` */ SI: 15,
|
|
29
|
-
/** `\u0010` */ DLE: 16,
|
|
30
|
-
/** `\u0011` */ DC1: 17,
|
|
31
|
-
/** `\u0012` */ DC2: 18,
|
|
32
|
-
/** `\u0013` */ DC3: 19,
|
|
33
|
-
/** `\u0014` */ DC4: 20,
|
|
34
|
-
/** `\u0015` */ NAK: 21,
|
|
35
|
-
/** `\u0016` */ SYN: 22,
|
|
36
|
-
/** `\u0017` */ ETB: 23,
|
|
37
|
-
/** `\u0018` */ CAN: 24,
|
|
38
|
-
/** `\u0019` */ EM: 25,
|
|
39
|
-
/** `\u001a` */ SUB: 26,
|
|
40
|
-
/** `\u001b` */ ESC: 27,
|
|
41
|
-
/** `\u001c` */ FS: 28,
|
|
42
|
-
/** `\u001d` */ GS: 29,
|
|
43
|
-
/** `\u001e` */ RS: 30,
|
|
44
|
-
/** `\u001f` */ US: 31,
|
|
45
|
-
/** " " */ SPACE: 32,
|
|
46
|
-
/** `!` */ EXCLAMATION: 33,
|
|
47
|
-
/** `"` */ DOUBLE_QUOTE: 34,
|
|
48
|
-
/** `#` */ HASH: 35,
|
|
49
|
-
/** `$` */ DOLLAR: 36,
|
|
50
|
-
/** `%` */ PERCENT: 37,
|
|
51
|
-
/** `&` */ AMPERSAND: 38,
|
|
52
|
-
/** `'` */ SINGLE_QUOTE: 39,
|
|
53
|
-
/** `(` */ LEFT_PAREN: 40,
|
|
54
|
-
/** `)` */ RIGHT_PAREN: 41,
|
|
55
|
-
/** `*` */ ASTERISK: 42,
|
|
56
|
-
/** `+` */ PLUS: 43,
|
|
57
|
-
/** `,` */ COMMA: 44,
|
|
58
|
-
/** `-` */ MINUS: 45,
|
|
59
|
-
/** `.` */ PERIOD: 46,
|
|
60
|
-
/** `/` */ SLASH: 47,
|
|
61
|
-
/** `0` */ ZERO: 48,
|
|
62
|
-
/** `1` */ ONE: 49,
|
|
63
|
-
/** `2` */ TWO: 50,
|
|
64
|
-
/** `3` */ THREE: 51,
|
|
65
|
-
/** `4` */ FOUR: 52,
|
|
66
|
-
/** `5` */ FIVE: 53,
|
|
67
|
-
/** `6` */ SIX: 54,
|
|
68
|
-
/** `7` */ SEVEN: 55,
|
|
69
|
-
/** `8` */ EIGHT: 56,
|
|
70
|
-
/** `9` */ NINE: 57,
|
|
71
|
-
/** `:` */ COLON: 58,
|
|
72
|
-
/** `;` */ SEMICOLON: 59,
|
|
73
|
-
/** `<` */ LESS_THAN: 60,
|
|
74
|
-
/** `=` */ EQUAL: 61,
|
|
75
|
-
/** `>` */ GREATER_THAN: 62,
|
|
76
|
-
/** `?` */ QUESTION: 63,
|
|
77
|
-
/** `@` */ AT: 64,
|
|
78
|
-
/** `A` */ A: 65,
|
|
79
|
-
/** `B` */ B: 66,
|
|
80
|
-
/** `C` */ C: 67,
|
|
81
|
-
/** `D` */ D: 68,
|
|
82
|
-
/** `E` */ E: 69,
|
|
83
|
-
/** `F` */ F: 70,
|
|
84
|
-
/** `G` */ G: 71,
|
|
85
|
-
/** `H` */ H: 72,
|
|
86
|
-
/** `I` */ I: 73,
|
|
87
|
-
/** `J` */ J: 74,
|
|
88
|
-
/** `K` */ K: 75,
|
|
89
|
-
/** `L` */ L: 76,
|
|
90
|
-
/** `M` */ M: 77,
|
|
91
|
-
/** `N` */ N: 78,
|
|
92
|
-
/** `O` */ O: 79,
|
|
93
|
-
/** `P` */ P: 80,
|
|
94
|
-
/** `Q` */ Q: 81,
|
|
95
|
-
/** `R` */ R: 82,
|
|
96
|
-
/** `S` */ S: 83,
|
|
97
|
-
/** `T` */ T: 84,
|
|
98
|
-
/** `U` */ U: 85,
|
|
99
|
-
/** `V` */ V: 86,
|
|
100
|
-
/** `W` */ W: 87,
|
|
101
|
-
/** `X` */ X: 88,
|
|
102
|
-
/** `Y` */ Y: 89,
|
|
103
|
-
/** `Z` */ Z: 90,
|
|
104
|
-
/** `[` */ LEFT_BRACKET: 91,
|
|
105
|
-
/** `\` */ BACKSLASH: 92,
|
|
106
|
-
/** `]` */ RIGHT_BRACKET: 93,
|
|
107
|
-
/** `^` */ CARET: 94,
|
|
108
|
-
/** `_` */ UNDERSCORE: 95,
|
|
109
|
-
/** __`__ */ GRAVE: 96,
|
|
110
|
-
/** `a` */ a: 97,
|
|
111
|
-
/** `b` */ b: 98,
|
|
112
|
-
/** `c` */ c: 99,
|
|
113
|
-
/** `d` */ d: 100,
|
|
114
|
-
/** `e` */ e: 101,
|
|
115
|
-
/** `f` */ f: 102,
|
|
116
|
-
/** `g` */ g: 103,
|
|
117
|
-
/** `h` */ h: 104,
|
|
118
|
-
/** `i` */ i: 105,
|
|
119
|
-
/** `j` */ j: 106,
|
|
120
|
-
/** `k` */ k: 107,
|
|
121
|
-
/** `l` */ l: 108,
|
|
122
|
-
/** `m` */ m: 109,
|
|
123
|
-
/** `n` */ n: 110,
|
|
124
|
-
/** `o` */ o: 111,
|
|
125
|
-
/** `p` */ p: 112,
|
|
126
|
-
/** `q` */ q: 113,
|
|
127
|
-
/** `r` */ r: 114,
|
|
128
|
-
/** `s` */ s: 115,
|
|
129
|
-
/** `t` */ t: 116,
|
|
130
|
-
/** `u` */ u: 117,
|
|
131
|
-
/** `v` */ v: 118,
|
|
132
|
-
/** `w` */ w: 119,
|
|
133
|
-
/** `x` */ x: 120,
|
|
134
|
-
/** `y` */ y: 121,
|
|
135
|
-
/** `z` */ z: 122,
|
|
136
|
-
/** `{` */ LEFT_BRACE: 123,
|
|
137
|
-
/** `|` */ PIPE: 124,
|
|
138
|
-
/** `}` */ RIGHT_BRACE: 125,
|
|
139
|
-
/** `~` */ TILDE: 126,
|
|
140
|
-
});
|