nadesiko3 3.7.13 → 3.7.14
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/batch/command.txt +473 -473
- package/batch/jsplugin2text.nako3 +2 -0
- package/core/package.json +1 -1
- package/core/src/nako3.mjs +0 -4
- package/core/src/nako3.mts +55 -55
- package/core/src/nako_ast.mjs +0 -1
- package/core/src/nako_ast.mts +1 -1
- package/core/src/nako_colors.mjs +0 -1
- package/core/src/nako_colors.mts +1 -1
- package/core/src/nako_core_version.mjs +2 -2
- package/core/src/nako_core_version.mts +2 -2
- package/core/src/nako_csv.mjs +0 -1
- package/core/src/nako_csv.mts +9 -9
- package/core/src/nako_errors.mts +8 -8
- package/core/src/nako_from_dncl.mts +5 -5
- package/core/src/nako_from_dncl2.mjs +0 -1
- package/core/src/nako_from_dncl2.mts +5 -5
- package/core/src/nako_gen.mjs +13 -15
- package/core/src/nako_gen.mts +224 -220
- package/core/src/nako_global.mts +11 -11
- package/core/src/nako_indent.mts +92 -92
- package/core/src/nako_indent_chars.mts +1 -1
- package/core/src/nako_indent_inline.mjs +11 -11
- package/core/src/nako_indent_inline.mts +20 -20
- package/core/src/nako_lex_rules.mjs +0 -1
- package/core/src/nako_lex_rules.mts +8 -8
- package/core/src/nako_lexer.mjs +0 -1
- package/core/src/nako_lexer.mts +23 -23
- package/core/src/nako_logger.mjs +1 -1
- package/core/src/nako_logger.mts +38 -38
- package/core/src/nako_parser3.mjs +4 -5
- package/core/src/nako_parser3.mts +79 -79
- package/core/src/nako_parser_base.mjs +1 -1
- package/core/src/nako_parser_base.mts +68 -68
- package/core/src/nako_parser_const.mjs +0 -1
- package/core/src/nako_parser_const.mts +1 -1
- package/core/src/nako_prepare.mts +12 -12
- package/core/src/nako_source_mapping.mts +9 -9
- package/core/src/nako_token.mjs +0 -1
- package/core/src/nako_token.mts +2 -2
- package/core/src/nako_tools.mjs +0 -1
- package/core/src/nako_tools.mts +4 -4
- package/core/src/nako_types.mjs +0 -1
- package/core/src/nako_types.mts +3 -3
- package/core/src/plugin_api.mjs +0 -1
- package/core/src/plugin_api.mts +1 -1
- package/core/src/plugin_csv.mjs +0 -1
- package/core/src/plugin_csv.mts +7 -7
- package/core/src/plugin_math.mjs +0 -1
- package/core/src/plugin_math.mts +39 -40
- package/core/src/plugin_promise.mjs +1 -1
- package/core/src/plugin_promise.mts +9 -9
- package/core/src/plugin_system.mjs +1 -10
- package/core/src/plugin_system.mts +319 -321
- package/core/src/plugin_test.mjs +0 -2
- package/core/src/plugin_test.mts +6 -6
- package/core/src/plugin_toml.mjs +1 -1
- package/core/src/plugin_toml.mts +4 -4
- package/core/test/flow_test.mjs +22 -0
- package/package.json +31 -34
- package/release/_hash.txt +24 -24
- package/release/_script-tags.txt +16 -16
- package/release/command_cnako3.json +1 -1
- package/release/edit_main.js +33 -21
- package/release/edit_main.js.map +4 -4
- package/release/editor.js +33 -21
- package/release/plugin_keigo.js.map +2 -2
- package/release/plugin_turtle.js.map +2 -2
- package/release/plugin_weykturtle3d.js.map +2 -2
- package/release/version.js +29 -17
- package/release/version_main.js +29 -17
- package/release/version_main.js.map +4 -4
- package/release/wnako3.js +51 -44
- package/release/wnako3.js.map +3 -3
- package/release/wnako3webworker.js +45 -38
- package/release/wnako3webworker.js.map +2 -2
- package/src/cnako3.mts +1 -1
- package/src/cnako3mod.mjs +4 -7
- package/src/cnako3mod.mts +24 -24
- package/src/commander_ja.mts +8 -8
- package/src/deno_wrapper.mjs +0 -1
- package/src/deno_wrapper.mts +5 -5
- package/src/nako_version.mjs +2 -2
- package/src/nako_version.mts +2 -2
- package/src/plugin_browser.mjs +21 -29
- package/src/plugin_browser.mts +30 -35
- package/src/plugin_browser_ajax.mts +27 -27
- package/src/plugin_browser_audio.mjs +0 -1
- package/src/plugin_browser_audio.mts +11 -11
- package/src/plugin_browser_camera.mts +8 -8
- package/src/plugin_browser_canvas.mjs +0 -2
- package/src/plugin_browser_canvas.mts +34 -34
- package/src/plugin_browser_chart.mjs +0 -1
- package/src/plugin_browser_chart.mts +13 -13
- package/src/plugin_browser_color.mts +2 -2
- package/src/plugin_browser_crypto.mts +5 -5
- package/src/plugin_browser_dialog.mts +4 -4
- package/src/plugin_browser_dom_basic.mts +42 -42
- package/src/plugin_browser_dom_event.mjs +0 -1
- package/src/plugin_browser_dom_event.mts +27 -28
- package/src/plugin_browser_dom_parts.mjs +0 -2
- package/src/plugin_browser_dom_parts.mts +31 -31
- package/src/plugin_browser_geolocation.mts +3 -3
- package/src/plugin_browser_hotkey.mts +3 -3
- package/src/plugin_browser_html.mts +4 -4
- package/src/plugin_browser_in_worker.mts +1 -1
- package/src/plugin_browser_location.mts +2 -2
- package/src/plugin_browser_speech.mts +7 -7
- package/src/plugin_browser_storage.mts +11 -11
- package/src/plugin_browser_system.mts +2 -2
- package/src/plugin_browser_websocket.mts +6 -6
- package/src/plugin_httpserver.mts +17 -17
- package/src/plugin_keigo.mts +5 -5
- package/src/plugin_node.mjs +7 -48
- package/src/plugin_node.mts +114 -145
- package/src/plugin_turtle.mts +143 -143
- package/src/plugin_weykturtle3d.mjs +0 -3
- package/src/plugin_weykturtle3d.mts +135 -135
- package/src/plugin_weykturtle3d_three.mjs +0 -1
- package/src/plugin_weykturtle3d_three.mts +1 -1
- package/src/plugin_weykturtle3d_threeutil.mts +3 -3
- package/src/wnako3.mjs +0 -1
- package/src/wnako3.mts +1 -1
- package/src/wnako3_editor.mjs +0 -2
- package/src/wnako3_editor.mts +132 -132
- package/src/wnako3mod.mjs +0 -5
- package/src/wnako3mod.mts +19 -19
|
@@ -16,7 +16,7 @@ class EasyURLItem {
|
|
|
16
16
|
action: EasyURLActionType
|
|
17
17
|
path: string
|
|
18
18
|
callback: EasyURLCallback
|
|
19
|
-
constructor
|
|
19
|
+
constructor(action: EasyURLActionType) {
|
|
20
20
|
this.action = action
|
|
21
21
|
this.url = ''
|
|
22
22
|
this.path = ''
|
|
@@ -32,7 +32,7 @@ class EasyURLDispather {
|
|
|
32
32
|
isEnd: boolean
|
|
33
33
|
usedHeader: boolean
|
|
34
34
|
|
|
35
|
-
constructor
|
|
35
|
+
constructor(sys: any) {
|
|
36
36
|
this.server = null
|
|
37
37
|
this.items = []
|
|
38
38
|
this.sys = sys
|
|
@@ -42,7 +42,7 @@ class EasyURLDispather {
|
|
|
42
42
|
this.usedHeader = false
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
doRequest
|
|
45
|
+
doRequest(req: any, res: any) {
|
|
46
46
|
this.curReq = req
|
|
47
47
|
this.curRes = res
|
|
48
48
|
console.log(`${HTTPSERVER_LOGID} 要求あり URL=` + req.url)
|
|
@@ -62,13 +62,13 @@ class EasyURLDispather {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
return404
|
|
65
|
+
return404(res: any) {
|
|
66
66
|
console.error(HTTPSERVER_LOGID, 404, '見当たりません。')
|
|
67
67
|
res.statusCode = 404
|
|
68
68
|
res.end('<html><meta charset="utf-8"><body><h1>404 見当たりません。</h1></body></html>')
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
doRequestStatic
|
|
71
|
+
doRequestStatic(req: any, res: any, it: EasyURLItem): boolean {
|
|
72
72
|
let url: string = ('' + req.url).replace(/\.\./g, '') // URLの..を許可しない
|
|
73
73
|
url = url.substring(it.url.length)
|
|
74
74
|
let fpath = path.join(it.path, url)
|
|
@@ -102,7 +102,7 @@ class EasyURLDispather {
|
|
|
102
102
|
return true
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
doRequestCallback
|
|
105
|
+
doRequestCallback(req: any, res: any, it: EasyURLItem): boolean {
|
|
106
106
|
this.isEnd = false
|
|
107
107
|
this.usedHeader = false
|
|
108
108
|
it.callback(req, res)
|
|
@@ -112,11 +112,11 @@ class EasyURLDispather {
|
|
|
112
112
|
return true
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
addItem
|
|
115
|
+
addItem(it: EasyURLItem) {
|
|
116
116
|
this.items.push(it)
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
parseURL
|
|
119
|
+
parseURL(uri: string): any {
|
|
120
120
|
const params: any = {}
|
|
121
121
|
if (uri.indexOf('?') >= 0) {
|
|
122
122
|
const a = uri.split('?')
|
|
@@ -143,7 +143,7 @@ const MimeTypes: any = {
|
|
|
143
143
|
'.gif': 'image/gif',
|
|
144
144
|
'.svg': 'svg+xml'
|
|
145
145
|
}
|
|
146
|
-
function getMIMEType
|
|
146
|
+
function getMIMEType(url: string) {
|
|
147
147
|
let ext = '.txt'
|
|
148
148
|
const m = url.match(/(\.[a-z0-9_]+)$/)
|
|
149
149
|
if (m) { ext = m[1] }
|
|
@@ -151,7 +151,7 @@ function getMIMEType (url: string) {
|
|
|
151
151
|
return 'text/plain'
|
|
152
152
|
}
|
|
153
153
|
// ディレクトリか判定
|
|
154
|
-
function isDir
|
|
154
|
+
function isDir(pathName: string) {
|
|
155
155
|
try {
|
|
156
156
|
// node v12以下ではエラーがあると例外を返す
|
|
157
157
|
const stats = fs.statSync(pathName)
|
|
@@ -178,7 +178,7 @@ const PluginHttpServer = {
|
|
|
178
178
|
type: 'func',
|
|
179
179
|
josi: [],
|
|
180
180
|
pure: true,
|
|
181
|
-
fn: function
|
|
181
|
+
fn: function(sys: any) {
|
|
182
182
|
sys.__httpserver = null
|
|
183
183
|
}
|
|
184
184
|
},
|
|
@@ -188,7 +188,7 @@ const PluginHttpServer = {
|
|
|
188
188
|
type: 'func',
|
|
189
189
|
josi: [['を'], ['の', 'で']],
|
|
190
190
|
pure: true,
|
|
191
|
-
fn: function
|
|
191
|
+
fn: function(callback: EasyHTTPOnStart, port: number, sys: any) {
|
|
192
192
|
// 管理オブジェクトを作成する
|
|
193
193
|
const dp = sys.__httpserver = new EasyURLDispather(sys)
|
|
194
194
|
// サーバオブジェクトを生成
|
|
@@ -207,7 +207,7 @@ const PluginHttpServer = {
|
|
|
207
207
|
type: 'func',
|
|
208
208
|
josi: [['を'], ['に', 'へ']],
|
|
209
209
|
pure: true,
|
|
210
|
-
fn: function
|
|
210
|
+
fn: function(url: string, path: string, sys: any) {
|
|
211
211
|
if (sys.__httpserver === null) {
|
|
212
212
|
throw new Error(ERR_NOHTTPSERVER)
|
|
213
213
|
}
|
|
@@ -222,7 +222,7 @@ const PluginHttpServer = {
|
|
|
222
222
|
type: 'func',
|
|
223
223
|
josi: [['を'], ['に', 'へ', 'で']],
|
|
224
224
|
pure: true,
|
|
225
|
-
fn: function
|
|
225
|
+
fn: function(callback: EasyURLCallback, url: string, sys: any) {
|
|
226
226
|
if (sys.__httpserver === null) {
|
|
227
227
|
throw new Error(ERR_NOHTTPSERVER)
|
|
228
228
|
}
|
|
@@ -240,7 +240,7 @@ const PluginHttpServer = {
|
|
|
240
240
|
type: 'func',
|
|
241
241
|
josi: [['を', 'と', 'の']],
|
|
242
242
|
pure: true,
|
|
243
|
-
fn: function
|
|
243
|
+
fn: function(s: string, sys: any) {
|
|
244
244
|
if (sys.__httpserver === null) {
|
|
245
245
|
throw new Error(ERR_NOHTTPSERVER)
|
|
246
246
|
}
|
|
@@ -260,7 +260,7 @@ const PluginHttpServer = {
|
|
|
260
260
|
type: 'func',
|
|
261
261
|
josi: [['で'], ['を', 'の', 'と']],
|
|
262
262
|
pure: true,
|
|
263
|
-
fn: function
|
|
263
|
+
fn: function(no: number, head: string, sys: any) {
|
|
264
264
|
if (sys.__httpserver === null) {
|
|
265
265
|
throw new Error(ERR_NOHTTPSERVER)
|
|
266
266
|
}
|
|
@@ -277,7 +277,7 @@ const PluginHttpServer = {
|
|
|
277
277
|
type: 'func',
|
|
278
278
|
josi: [['へ', 'に']],
|
|
279
279
|
pure: true,
|
|
280
|
-
fn: function
|
|
280
|
+
fn: function(url: string, sys: any) {
|
|
281
281
|
if (sys.__httpserver === null) {
|
|
282
282
|
throw new Error(ERR_NOHTTPSERVER)
|
|
283
283
|
}
|
package/src/plugin_keigo.mts
CHANGED
|
@@ -16,7 +16,7 @@ const PluginKeigo = {
|
|
|
16
16
|
type: 'func',
|
|
17
17
|
josi: [],
|
|
18
18
|
pure: true,
|
|
19
|
-
fn: function
|
|
19
|
+
fn: function(sys: NakoSystem) {
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
// @丁寧語
|
|
@@ -25,7 +25,7 @@ const PluginKeigo = {
|
|
|
25
25
|
type: 'func',
|
|
26
26
|
josi: [['に', 'へ']],
|
|
27
27
|
pure: true,
|
|
28
|
-
fn: function
|
|
28
|
+
fn: function(a: any, sys: NakoSystem) {
|
|
29
29
|
return a
|
|
30
30
|
}
|
|
31
31
|
},
|
|
@@ -33,7 +33,7 @@ const PluginKeigo = {
|
|
|
33
33
|
type: 'func',
|
|
34
34
|
josi: [],
|
|
35
35
|
pure: true,
|
|
36
|
-
fn: function
|
|
36
|
+
fn: function(sys: NakoSystem) {
|
|
37
37
|
if (!sys.__reisetu) { sys.__reisetu = 0 }
|
|
38
38
|
sys.__reisetu++
|
|
39
39
|
},
|
|
@@ -43,7 +43,7 @@ const PluginKeigo = {
|
|
|
43
43
|
type: 'func',
|
|
44
44
|
josi: [],
|
|
45
45
|
pure: true,
|
|
46
|
-
fn: function
|
|
46
|
+
fn: function(sys: NakoSystem) {
|
|
47
47
|
if (!sys.__reisetu) { sys.__reisetu = 0 }
|
|
48
48
|
sys.__reisetu++
|
|
49
49
|
},
|
|
@@ -53,7 +53,7 @@ const PluginKeigo = {
|
|
|
53
53
|
type: 'func',
|
|
54
54
|
josi: [],
|
|
55
55
|
pure: true,
|
|
56
|
-
fn: function
|
|
56
|
+
fn: function(sys: NakoSystem) {
|
|
57
57
|
if (!sys.__reisetu) { sys.__reisetu = 0 }
|
|
58
58
|
sys.__reisetu++
|
|
59
59
|
},
|
package/src/plugin_node.mjs
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
1
|
/**
|
|
3
2
|
* file: plugin_node.mjs
|
|
4
3
|
* node.js のためのプラグイン
|
|
5
4
|
*/
|
|
6
5
|
import fs from 'node:fs';
|
|
7
|
-
import fse from 'fs-extra';
|
|
8
|
-
import fetch, { FormData, Blob } from 'node-fetch';
|
|
9
6
|
import { exec, execSync, spawn } from 'node:child_process';
|
|
10
|
-
import shellQuote from 'shell-quote';
|
|
11
7
|
import path from 'node:path';
|
|
12
|
-
import iconv from 'iconv-lite';
|
|
13
|
-
import opener from 'opener';
|
|
14
8
|
import assert from 'node:assert';
|
|
15
9
|
// ハッシュ関数で利用
|
|
16
10
|
import crypto from 'node:crypto';
|
|
17
11
|
import os from 'node:os';
|
|
18
12
|
import url from 'node:url';
|
|
19
|
-
|
|
13
|
+
import opener from 'opener';
|
|
14
|
+
import iconv from 'iconv-lite';
|
|
15
|
+
import shellQuote from 'shell-quote';
|
|
16
|
+
import fetch, { FormData, Blob } from 'node-fetch';
|
|
17
|
+
import fse from 'fs-extra';
|
|
20
18
|
import { isWindows, getCommandLineArgs } from './deno_wrapper.mjs';
|
|
21
19
|
const __filename = url.fileURLToPath(import.meta.url);
|
|
22
20
|
const __dirname = path.dirname(__filename);
|
|
@@ -25,7 +23,6 @@ function fileExists(f) {
|
|
|
25
23
|
try {
|
|
26
24
|
fs.statSync(f);
|
|
27
25
|
return true;
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29
26
|
}
|
|
30
27
|
catch (err) {
|
|
31
28
|
return false;
|
|
@@ -35,7 +32,6 @@ function isDir(f) {
|
|
|
35
32
|
try {
|
|
36
33
|
const st = fs.statSync(f);
|
|
37
34
|
return st.isDirectory();
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
39
35
|
}
|
|
40
36
|
catch (err) {
|
|
41
37
|
return false;
|
|
@@ -177,7 +173,7 @@ export default {
|
|
|
177
173
|
try {
|
|
178
174
|
sys.tags.__stdinRaw += buf.toString();
|
|
179
175
|
}
|
|
180
|
-
catch (
|
|
176
|
+
catch (_err) { /* ignore */ }
|
|
181
177
|
const bufStr = buf.toString();
|
|
182
178
|
for (let i = 0; i < bufStr.length; i++) {
|
|
183
179
|
const c = bufStr.charAt(i);
|
|
@@ -203,7 +199,7 @@ export default {
|
|
|
203
199
|
try {
|
|
204
200
|
w();
|
|
205
201
|
}
|
|
206
|
-
catch (
|
|
202
|
+
catch (_err) { /* ignore */ }
|
|
207
203
|
}
|
|
208
204
|
sys.tags.__endWaiters = [];
|
|
209
205
|
}
|
|
@@ -252,7 +248,6 @@ export default {
|
|
|
252
248
|
type: 'func',
|
|
253
249
|
josi: [['を', 'から']],
|
|
254
250
|
pure: true,
|
|
255
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
256
251
|
fn: function (s, sys) {
|
|
257
252
|
return fs.readFileSync(s);
|
|
258
253
|
}
|
|
@@ -288,7 +283,6 @@ export default {
|
|
|
288
283
|
type: 'func',
|
|
289
284
|
josi: [['を', 'から']],
|
|
290
285
|
pure: true,
|
|
291
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
292
286
|
fn: function (s, sys) {
|
|
293
287
|
// iconv.skipDecodeWarning = true
|
|
294
288
|
const buf = fs.readFileSync(s);
|
|
@@ -300,7 +294,6 @@ export default {
|
|
|
300
294
|
type: 'func',
|
|
301
295
|
josi: [['を'], ['へ', 'に']],
|
|
302
296
|
pure: true,
|
|
303
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
304
297
|
fn: function (s, f, sys) {
|
|
305
298
|
// iconv.skipDecodeWarning = true
|
|
306
299
|
const buf = iconv.encode(s, 'Shift_JIS');
|
|
@@ -312,7 +305,6 @@ export default {
|
|
|
312
305
|
type: 'func',
|
|
313
306
|
josi: [['を', 'から']],
|
|
314
307
|
pure: true,
|
|
315
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
316
308
|
fn: function (s, sys) {
|
|
317
309
|
const buf = fs.readFileSync(s);
|
|
318
310
|
const text = iconv.decode(Buffer.from(buf), 'euc-jp');
|
|
@@ -323,7 +315,6 @@ export default {
|
|
|
323
315
|
type: 'func',
|
|
324
316
|
josi: [['を'], ['へ', 'に']],
|
|
325
317
|
pure: true,
|
|
326
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
327
318
|
fn: function (s, f, sys) {
|
|
328
319
|
const buf = iconv.encode(s, 'euc-jp');
|
|
329
320
|
fs.writeFileSync(f, buf);
|
|
@@ -360,7 +351,6 @@ export default {
|
|
|
360
351
|
type: 'func',
|
|
361
352
|
josi: [['で'], ['を']],
|
|
362
353
|
pure: true,
|
|
363
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
364
354
|
fn: function (callback, s, sys) {
|
|
365
355
|
exec(s, (err, stdout, stderr) => {
|
|
366
356
|
if (err) {
|
|
@@ -466,7 +456,6 @@ export default {
|
|
|
466
456
|
let st;
|
|
467
457
|
try {
|
|
468
458
|
st = fs.statSync(fullpath);
|
|
469
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
470
459
|
}
|
|
471
460
|
catch (e) {
|
|
472
461
|
continue;
|
|
@@ -559,7 +548,6 @@ export default {
|
|
|
559
548
|
type: 'func',
|
|
560
549
|
josi: [['で'], ['から', 'を'], ['に', 'へ']],
|
|
561
550
|
pure: true,
|
|
562
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
563
551
|
fn: function (callback, a, b, sys) {
|
|
564
552
|
fse.move(a, b, (err) => {
|
|
565
553
|
if (err) {
|
|
@@ -596,7 +584,6 @@ export default {
|
|
|
596
584
|
type: 'func',
|
|
597
585
|
josi: [['の', 'から']],
|
|
598
586
|
pure: true,
|
|
599
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
600
587
|
fn: function (path, sys) {
|
|
601
588
|
return fs.statSync(path);
|
|
602
589
|
}
|
|
@@ -605,7 +592,6 @@ export default {
|
|
|
605
592
|
type: 'func',
|
|
606
593
|
josi: [['の', 'から']],
|
|
607
594
|
pure: true,
|
|
608
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
609
595
|
fn: function (path, sys) {
|
|
610
596
|
const st = fs.statSync(path);
|
|
611
597
|
if (!st) {
|
|
@@ -723,7 +709,6 @@ export default {
|
|
|
723
709
|
type: 'func',
|
|
724
710
|
josi: [],
|
|
725
711
|
pure: true,
|
|
726
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
727
712
|
fn: function (sys) {
|
|
728
713
|
// 環境変数からテンポラリフォルダを取得
|
|
729
714
|
return os.tmpdir();
|
|
@@ -733,7 +718,6 @@ export default {
|
|
|
733
718
|
type: 'func',
|
|
734
719
|
josi: [['に', 'へ']],
|
|
735
720
|
pure: true,
|
|
736
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
737
721
|
fn: function (dir, sys) {
|
|
738
722
|
if (dir === '' || !dir) {
|
|
739
723
|
dir = os.tmpdir();
|
|
@@ -792,7 +776,6 @@ export default {
|
|
|
792
776
|
a = sys.tags.__quotePath(a);
|
|
793
777
|
b = sys.tags.__quotePath(b);
|
|
794
778
|
const cmd = `${tpath} x ${a} -o${b} -y`;
|
|
795
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
796
779
|
exec(cmd, (err, stdout, stderr) => {
|
|
797
780
|
if (err) {
|
|
798
781
|
throw new Error('[エラー]『解凍時』' + err);
|
|
@@ -824,7 +807,6 @@ export default {
|
|
|
824
807
|
a = sys.tags.__quotePath(a);
|
|
825
808
|
b = sys.tags.__quotePath(b);
|
|
826
809
|
const cmd = `${tpath} a -r ${b} ${a} -y`;
|
|
827
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
828
810
|
exec(cmd, (err, stdout, stderr) => {
|
|
829
811
|
if (err) {
|
|
830
812
|
throw new Error('[エラー]『圧縮時』' + (err.message || JSON.stringify(err)));
|
|
@@ -852,7 +834,6 @@ export default {
|
|
|
852
834
|
if (typeof (func) === 'string') {
|
|
853
835
|
func = sys.__findFunc(func, '強制終了時');
|
|
854
836
|
}
|
|
855
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
856
837
|
nodeProcess.on('SIGINT', (signal) => {
|
|
857
838
|
const flag = func(sys);
|
|
858
839
|
if (flag) {
|
|
@@ -875,7 +856,6 @@ export default {
|
|
|
875
856
|
type: 'func',
|
|
876
857
|
josi: [],
|
|
877
858
|
pure: true,
|
|
878
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
879
859
|
fn: function (sys) {
|
|
880
860
|
return nodeProcess.platform;
|
|
881
861
|
}
|
|
@@ -884,7 +864,6 @@ export default {
|
|
|
884
864
|
type: 'func',
|
|
885
865
|
josi: [],
|
|
886
866
|
pure: true,
|
|
887
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
888
867
|
fn: function (sys) {
|
|
889
868
|
return nodeProcess.arch;
|
|
890
869
|
}
|
|
@@ -947,7 +926,6 @@ export default {
|
|
|
947
926
|
josi: [],
|
|
948
927
|
pure: true,
|
|
949
928
|
asyncFn: true,
|
|
950
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
951
929
|
fn: function (sys) {
|
|
952
930
|
sys.tags.__setupStdin();
|
|
953
931
|
return new Promise((resolve) => {
|
|
@@ -965,7 +943,6 @@ export default {
|
|
|
965
943
|
type: 'func',
|
|
966
944
|
josi: [['と'], ['が']],
|
|
967
945
|
pure: true,
|
|
968
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
969
946
|
fn: function (a, b, sys) {
|
|
970
947
|
assert.strictEqual(a, b);
|
|
971
948
|
}
|
|
@@ -975,7 +952,6 @@ export default {
|
|
|
975
952
|
type: 'func',
|
|
976
953
|
josi: [],
|
|
977
954
|
pure: true,
|
|
978
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
979
955
|
fn: function (sys) {
|
|
980
956
|
const nif = os.networkInterfaces();
|
|
981
957
|
if (!nif) {
|
|
@@ -1003,7 +979,6 @@ export default {
|
|
|
1003
979
|
type: 'func',
|
|
1004
980
|
josi: [],
|
|
1005
981
|
pure: true,
|
|
1006
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1007
982
|
fn: function (sys) {
|
|
1008
983
|
const nif = os.networkInterfaces();
|
|
1009
984
|
if (!nif) {
|
|
@@ -1070,7 +1045,6 @@ export default {
|
|
|
1070
1045
|
pure: true,
|
|
1071
1046
|
fn: function (callback, url, params, sys) {
|
|
1072
1047
|
const flist = [];
|
|
1073
|
-
// eslint-disable-next-line @typescript-eslint/no-for-in-array
|
|
1074
1048
|
for (const key in params) {
|
|
1075
1049
|
const v = params[key];
|
|
1076
1050
|
const kv = encodeURIComponent(key) + '=' + encodeURIComponent(v);
|
|
@@ -1173,10 +1147,8 @@ export default {
|
|
|
1173
1147
|
type: 'func',
|
|
1174
1148
|
josi: [['まで', 'へ', 'に'], ['を']],
|
|
1175
1149
|
pure: true,
|
|
1176
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1177
1150
|
fn: function (url, params, sys) {
|
|
1178
1151
|
const flist = [];
|
|
1179
|
-
// eslint-disable-next-line @typescript-eslint/no-for-in-array
|
|
1180
1152
|
for (const key in params) {
|
|
1181
1153
|
const v = params[key];
|
|
1182
1154
|
const kv = encodeURIComponent(key) + '=' + encodeURIComponent(v);
|
|
@@ -1198,7 +1170,6 @@ export default {
|
|
|
1198
1170
|
type: 'func',
|
|
1199
1171
|
josi: [['まで', 'へ', 'に'], ['を']],
|
|
1200
1172
|
pure: true,
|
|
1201
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1202
1173
|
fn: function (url, params, sys) {
|
|
1203
1174
|
const fd = new FormData();
|
|
1204
1175
|
for (const key in params) {
|
|
@@ -1216,7 +1187,6 @@ export default {
|
|
|
1216
1187
|
type: 'func',
|
|
1217
1188
|
josi: [['から'], ['で']],
|
|
1218
1189
|
pure: true,
|
|
1219
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1220
1190
|
fn: function (res, type, sys) {
|
|
1221
1191
|
type = type.toString().toUpperCase();
|
|
1222
1192
|
if (type === 'TEXT' || type === 'テキスト') {
|
|
@@ -1267,7 +1237,6 @@ export default {
|
|
|
1267
1237
|
type: 'func',
|
|
1268
1238
|
josi: [['の', 'を']],
|
|
1269
1239
|
pure: true,
|
|
1270
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1271
1240
|
fn: function (params, sys) {
|
|
1272
1241
|
const flist = [];
|
|
1273
1242
|
for (const key in params) {
|
|
@@ -1308,7 +1277,6 @@ export default {
|
|
|
1308
1277
|
josi: [['まで', 'へ', 'に'], ['を']],
|
|
1309
1278
|
pure: true,
|
|
1310
1279
|
asyncFn: true,
|
|
1311
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1312
1280
|
fn: function (url, params, sys) {
|
|
1313
1281
|
return new Promise((resolve, reject) => {
|
|
1314
1282
|
const fd = new FormData();
|
|
@@ -1445,7 +1413,6 @@ export default {
|
|
|
1445
1413
|
type: 'func',
|
|
1446
1414
|
josi: [['の', 'を']],
|
|
1447
1415
|
pure: true,
|
|
1448
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1449
1416
|
fn: function (code, sys) {
|
|
1450
1417
|
return iconv.encodingExists(code);
|
|
1451
1418
|
}
|
|
@@ -1454,7 +1421,6 @@ export default {
|
|
|
1454
1421
|
type: 'func',
|
|
1455
1422
|
josi: [['に', 'へ', 'を']],
|
|
1456
1423
|
pure: true,
|
|
1457
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1458
1424
|
fn: function (str, sys) {
|
|
1459
1425
|
// iconv.skipDecodeWarning = true
|
|
1460
1426
|
return iconv.encode(str, 'Shift_JIS');
|
|
@@ -1464,7 +1430,6 @@ export default {
|
|
|
1464
1430
|
type: 'func',
|
|
1465
1431
|
josi: [['から', 'を', 'で']],
|
|
1466
1432
|
pure: true,
|
|
1467
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1468
1433
|
fn: function (buf, sys) {
|
|
1469
1434
|
// iconv.skipDecodeWarning = true
|
|
1470
1435
|
return iconv.decode(Buffer.from(buf), 'sjis');
|
|
@@ -1474,7 +1439,6 @@ export default {
|
|
|
1474
1439
|
type: 'func',
|
|
1475
1440
|
josi: [['を'], ['へ', 'で']],
|
|
1476
1441
|
pure: true,
|
|
1477
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1478
1442
|
fn: function (s, code, sys) {
|
|
1479
1443
|
// iconv.skipDecodeWarning = true
|
|
1480
1444
|
return iconv.encode(s, code);
|
|
@@ -1484,7 +1448,6 @@ export default {
|
|
|
1484
1448
|
type: 'func',
|
|
1485
1449
|
josi: [['を'], ['から', 'で']],
|
|
1486
1450
|
pure: true,
|
|
1487
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1488
1451
|
fn: function (buf, code, sys) {
|
|
1489
1452
|
// iconv.skipDecodeWarning = true
|
|
1490
1453
|
return iconv.decode(Buffer.from(buf), code);
|
|
@@ -1495,7 +1458,6 @@ export default {
|
|
|
1495
1458
|
type: 'func',
|
|
1496
1459
|
josi: [],
|
|
1497
1460
|
pure: true,
|
|
1498
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1499
1461
|
fn: function (sys) {
|
|
1500
1462
|
return crypto.getHashes();
|
|
1501
1463
|
}
|
|
@@ -1504,7 +1466,6 @@ export default {
|
|
|
1504
1466
|
type: 'func',
|
|
1505
1467
|
josi: [['を'], ['の'], ['で']],
|
|
1506
1468
|
pure: true,
|
|
1507
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1508
1469
|
fn: function (s, alg, enc, sys) {
|
|
1509
1470
|
const hashsum = crypto.createHash(alg);
|
|
1510
1471
|
hashsum.update(s);
|
|
@@ -1515,7 +1476,6 @@ export default {
|
|
|
1515
1476
|
type: 'func',
|
|
1516
1477
|
josi: [],
|
|
1517
1478
|
pure: true,
|
|
1518
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1519
1479
|
fn: function (sys) {
|
|
1520
1480
|
const uuid = crypto.randomUUID();
|
|
1521
1481
|
return uuid;
|
|
@@ -1525,7 +1485,6 @@ export default {
|
|
|
1525
1485
|
type: 'func',
|
|
1526
1486
|
josi: [['の']],
|
|
1527
1487
|
pure: true,
|
|
1528
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1529
1488
|
fn: function (cnt, sys) {
|
|
1530
1489
|
const a = new Uint8Array(cnt);
|
|
1531
1490
|
crypto.getRandomValues(a);
|