nadesiko3 3.7.21 → 3.7.22
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 +370 -334
- package/batch/jsplugin2text.nako3 +1 -1
- package/batch/pickup_command.nako3 +12 -0
- package/core/command/snako.mts +5 -1
- package/core/deno/snako.ts +5 -1
- package/core/package-lock.json +382 -21
- package/core/package.json +4 -4
- package/core/src/nako3.mts +178 -614
- package/core/src/nako_basic_plugins.mts +39 -0
- package/core/src/nako_core_version.mts +2 -2
- package/core/src/nako_csv.mts +0 -1
- package/core/src/nako_event.mts +49 -0
- package/core/src/nako_gen.mts +291 -202
- package/core/src/nako_indent_inline.mts +2 -2
- package/core/src/nako_lex_rules.mts +1 -1
- package/core/src/nako_parser3.mts +106 -165
- package/core/src/nako_parser_async.mts +97 -0
- package/core/src/nako_parser_base.mts +4 -55
- package/core/src/nako_parser_message.mts +105 -0
- package/core/src/nako_parser_operator.mts +93 -0
- package/core/src/nako_plugin_manager.mts +260 -0
- package/core/src/nako_require.mts +292 -0
- package/core/src/nako_runner.mts +191 -0
- package/core/src/nako_tokenizer.mts +221 -0
- package/core/src/plugin_csv.mts +1 -1
- package/core/src/plugin_system.mts +34 -3259
- package/core/src/plugin_system_array.mts +699 -0
- package/core/src/plugin_system_datetime.mts +368 -0
- package/core/src/plugin_system_debug.mts +403 -0
- package/core/src/plugin_system_dict.mts +85 -0
- package/core/src/plugin_system_json.mts +73 -0
- package/core/src/plugin_system_math.mts +383 -0
- package/core/src/plugin_system_regexp.mts +120 -0
- package/core/src/plugin_system_stdio.mts +86 -0
- package/core/src/plugin_system_string.mts +666 -0
- package/core/src/plugin_system_timer.mts +152 -0
- package/core/src/plugin_system_types.mts +151 -0
- package/core/src/plugin_system_url.mts +193 -0
- package/core/src/plugin_toml.mts +3 -3
- package/core/test/fixtures/README.md +39 -0
- package/core/test/fixtures/make_parser_ast_golden.mjs +31 -0
- package/core/test/fixtures/parser_ast_golden.json +8027 -0
- package/core/test/fixtures/parser_corpus.mjs +120 -0
- package/core/test/indent_test.mjs +6 -0
- package/core/test/nako_basic_plugins_test.mjs +44 -0
- package/core/test/nako_event_test.mjs +85 -0
- package/core/test/nako_gen_perf_test.mjs +178 -0
- package/core/test/nako_parser_async_test.mjs +112 -0
- package/core/test/nako_parser_test.mjs +160 -0
- package/core/test/nako_plugin_manager_test.mjs +185 -0
- package/core/test/nako_require_test.mjs +153 -0
- package/core/test/nako_runner_test.mjs +114 -0
- package/core/test/nako_tokenizer_test.mjs +115 -0
- package/core/test/plugin_system_debug_test.mjs +141 -0
- package/core/test/plugin_system_split_test.mjs +179 -0
- package/core/test/plugin_system_test.mjs +6 -0
- package/core/tsconfig.json +0 -1
- package/package.json +17 -21
- package/release/_hash.txt +36 -36
- package/release/_script-tags.txt +16 -16
- package/release/command.json +1 -1
- package/release/command.json.js +1 -1
- package/release/command_cnako3.json +1 -1
- package/release/command_list.json +1 -1
- package/release/edit_main.js +6 -6
- package/release/edit_main.js.map +3 -3
- package/release/editor.js +6 -6
- package/release/plugin_keigo.js.map +3 -3
- package/release/plugin_markup.js +46 -46
- package/release/plugin_markup.js.map +3 -3
- package/release/plugin_weykturtle3d.js +1 -1
- package/release/plugin_weykturtle3d.js.map +3 -3
- package/release/version.js +2 -2
- package/release/version_main.js +2 -2
- package/release/version_main.js.map +1 -1
- package/release/wnako3.js +186 -213
- package/release/wnako3.js.map +4 -4
- package/release/wnako3webworker.js +172 -199
- package/release/wnako3webworker.js.map +4 -4
- package/src/cnako3mod.mjs +7 -2
- package/src/cnako3mod.mts +7 -2
- package/src/nako_version.mjs +2 -2
- package/src/nako_version.mts +2 -2
- package/src/plugin_browser_ajax.mjs +4 -4
- package/src/plugin_browser_ajax.mts +4 -4
- package/src/plugin_browser_audio.mjs +10 -10
- package/src/plugin_browser_audio.mts +10 -10
- package/src/plugin_browser_camera.mjs +4 -4
- package/src/plugin_browser_camera.mts +4 -4
- package/src/plugin_browser_canvas.mjs +2 -2
- package/src/plugin_browser_canvas.mts +2 -2
- package/src/plugin_browser_crypto.mjs +3 -3
- package/src/plugin_browser_crypto.mts +3 -3
- package/src/plugin_browser_dom_event.mjs +1 -1
- package/src/plugin_browser_dom_event.mts +1 -1
- package/src/plugin_browser_geolocation.mjs +1 -1
- package/src/plugin_browser_geolocation.mts +1 -1
- package/src/plugin_browser_hotkey.mjs +1 -1
- package/src/plugin_browser_hotkey.mts +1 -1
- package/src/plugin_browser_html.mjs +1 -1
- package/src/plugin_browser_html.mts +1 -1
- package/src/plugin_browser_location.mjs +1 -1
- package/src/plugin_browser_location.mts +1 -1
- package/src/plugin_browser_speech.mjs +1 -1
- package/src/plugin_browser_speech.mts +1 -1
- package/src/plugin_browser_storage.mjs +2 -2
- package/src/plugin_browser_storage.mts +2 -2
- package/src/plugin_httpserver.mjs +3 -3
- package/src/plugin_httpserver.mts +3 -3
- package/src/plugin_keigo.mjs +2 -2
- package/src/plugin_keigo.mts +2 -2
- package/src/plugin_node.mjs +48 -48
- package/src/plugin_node.mts +53 -53
- package/src/plugin_weykturtle3d.mjs +56 -56
- package/src/plugin_weykturtle3d.mts +56 -56
- package/src/wnako3.mjs +1 -1
- package/src/wnako3.mts +1 -1
- package/src/wnako3_editor.mjs +5 -5
- package/src/wnako3_editor.mts +5 -5
- package/src/wnako3mod.mjs +2 -2
- package/src/wnako3mod.mts +2 -2
- package/core/src/nako3.mjs +0 -1021
- package/core/src/nako_ast.mjs +0 -4
- package/core/src/nako_colors.mjs +0 -77
- package/core/src/nako_core_version.mjs +0 -8
- package/core/src/nako_csv.mjs +0 -193
- package/core/src/nako_errors.mjs +0 -166
- package/core/src/nako_from_dncl.mjs +0 -285
- package/core/src/nako_from_dncl2.mjs +0 -347
- package/core/src/nako_gen.mjs +0 -2500
- package/core/src/nako_global.mjs +0 -138
- package/core/src/nako_indent.mjs +0 -442
- package/core/src/nako_indent_chars.mjs +0 -29
- package/core/src/nako_indent_inline.mjs +0 -361
- package/core/src/nako_josi_list.mjs +0 -47
- package/core/src/nako_lex_rules.mjs +0 -319
- package/core/src/nako_lexer.mjs +0 -794
- package/core/src/nako_logger.mjs +0 -221
- package/core/src/nako_parser3.mjs +0 -3250
- package/core/src/nako_parser_base.mjs +0 -403
- package/core/src/nako_parser_const.mjs +0 -37
- package/core/src/nako_prepare.mjs +0 -329
- package/core/src/nako_reserved_words.mjs +0 -42
- package/core/src/nako_source_mapping.mjs +0 -207
- package/core/src/nako_test.mjs +0 -37
- package/core/src/nako_token.mjs +0 -1
- package/core/src/nako_tools.mjs +0 -53
- package/core/src/nako_types.mjs +0 -14
- package/core/src/plugin_api.mjs +0 -4
- package/core/src/plugin_csv.mjs +0 -97
- package/core/src/plugin_math.mjs +0 -352
- package/core/src/plugin_promise.mjs +0 -102
- package/core/src/plugin_system.mjs +0 -3810
- package/core/src/plugin_test.mjs +0 -52
- package/core/src/plugin_toml.mjs +0 -39
package/src/plugin_node.mts
CHANGED
|
@@ -9,7 +9,7 @@ import path from 'node:path'
|
|
|
9
9
|
import assert from 'node:assert'
|
|
10
10
|
// ハッシュ関数で利用
|
|
11
11
|
import crypto from 'node:crypto'
|
|
12
|
-
import os
|
|
12
|
+
import os from 'node:os'
|
|
13
13
|
import url from 'node:url'
|
|
14
14
|
import opener from 'opener'
|
|
15
15
|
import iconv from 'iconv-lite'
|
|
@@ -18,7 +18,7 @@ import fse from 'fs-extra'
|
|
|
18
18
|
import { NakoSystem } from '../core/src/plugin_api.mjs'
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
import { getEnv, isWindows, getCommandLineArgs
|
|
21
|
+
import { getEnv, isWindows, getCommandLineArgs } from './deno_wrapper.mjs'
|
|
22
22
|
|
|
23
23
|
const __filename = url.fileURLToPath(import.meta.url)
|
|
24
24
|
const __dirname = path.dirname(__filename)
|
|
@@ -28,8 +28,8 @@ function fileExists(f: string): boolean {
|
|
|
28
28
|
try {
|
|
29
29
|
fs.statSync(f)
|
|
30
30
|
return true
|
|
31
|
-
|
|
32
|
-
} catch
|
|
31
|
+
|
|
32
|
+
} catch {
|
|
33
33
|
return false
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -38,8 +38,8 @@ function isDir(f: string): boolean {
|
|
|
38
38
|
try {
|
|
39
39
|
const st = fs.statSync(f)
|
|
40
40
|
return st.isDirectory()
|
|
41
|
-
|
|
42
|
-
} catch
|
|
41
|
+
|
|
42
|
+
} catch {
|
|
43
43
|
return false
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -48,7 +48,7 @@ function commandExists(command: string): boolean {
|
|
|
48
48
|
try {
|
|
49
49
|
const r = spawnSync('which', [command], { stdio: 'ignore' })
|
|
50
50
|
return r.status === 0
|
|
51
|
-
} catch
|
|
51
|
+
} catch {
|
|
52
52
|
return false
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -171,7 +171,7 @@ async function listFilesRecursive(baseDir: string, curPath: string): Promise<Arr
|
|
|
171
171
|
let stat: any
|
|
172
172
|
try {
|
|
173
173
|
stat = await fs.promises.stat(curPath)
|
|
174
|
-
} catch
|
|
174
|
+
} catch {
|
|
175
175
|
return []
|
|
176
176
|
}
|
|
177
177
|
if (stat.isFile()) {
|
|
@@ -337,7 +337,7 @@ export default {
|
|
|
337
337
|
const emitLine = (line: string) => {
|
|
338
338
|
// 永続ハンドラーへ通知(『標準入力取得時』など)
|
|
339
339
|
for (const h of sys.tags.__lineHandlers) {
|
|
340
|
-
try { h(line) } catch
|
|
340
|
+
try { h(line) } catch { /* ignore */ }
|
|
341
341
|
}
|
|
342
342
|
// 一度きりの待機者(『尋』『文字尋』)へ優先的に配信、なければキュー
|
|
343
343
|
if (sys.tags.__stdinWaiters.length > 0) {
|
|
@@ -349,7 +349,7 @@ export default {
|
|
|
349
349
|
}
|
|
350
350
|
nodeProcess.stdin.on('data', (buf: Buffer) => {
|
|
351
351
|
// 生データも保持(『標準入力全取得』向け)
|
|
352
|
-
try { sys.tags.__stdinRaw += buf.toString() } catch
|
|
352
|
+
try { sys.tags.__stdinRaw += buf.toString() } catch { /* ignore */ }
|
|
353
353
|
const bufStr = buf.toString()
|
|
354
354
|
for (let i = 0; i < bufStr.length; i++) {
|
|
355
355
|
const c = bufStr.charAt(i)
|
|
@@ -370,7 +370,7 @@ export default {
|
|
|
370
370
|
sys.tags.__stdinEnded = true
|
|
371
371
|
if (sys.tags.__endWaiters && Array.isArray(sys.tags.__endWaiters)) {
|
|
372
372
|
for (const w of sys.tags.__endWaiters) {
|
|
373
|
-
try { w() } catch
|
|
373
|
+
try { w() } catch { /* ignore */ }
|
|
374
374
|
}
|
|
375
375
|
sys.tags.__endWaiters = []
|
|
376
376
|
}
|
|
@@ -422,7 +422,7 @@ export default {
|
|
|
422
422
|
type: 'func',
|
|
423
423
|
josi: [['を', 'から']],
|
|
424
424
|
pure: true,
|
|
425
|
-
fn: function(s: string,
|
|
425
|
+
fn: function(s: string, _sys: NakoSystem) {
|
|
426
426
|
return fs.readFileSync(s)
|
|
427
427
|
}
|
|
428
428
|
},
|
|
@@ -453,7 +453,7 @@ export default {
|
|
|
453
453
|
type: 'func',
|
|
454
454
|
josi: [['を', 'から']],
|
|
455
455
|
pure: true,
|
|
456
|
-
fn: function(s: string,
|
|
456
|
+
fn: function(s: string, _sys: NakoSystem) {
|
|
457
457
|
// iconv.skipDecodeWarning = true
|
|
458
458
|
const buf = fs.readFileSync(s)
|
|
459
459
|
const text = iconv.decode(Buffer.from(buf), 'sjis')
|
|
@@ -464,7 +464,7 @@ export default {
|
|
|
464
464
|
type: 'func',
|
|
465
465
|
josi: [['を'], ['へ', 'に']],
|
|
466
466
|
pure: true,
|
|
467
|
-
fn: function(s: string, f: string,
|
|
467
|
+
fn: function(s: string, f: string, _sys: NakoSystem) {
|
|
468
468
|
// iconv.skipDecodeWarning = true
|
|
469
469
|
const buf = iconv.encode(s, 'Shift_JIS')
|
|
470
470
|
fs.writeFileSync(f, buf)
|
|
@@ -475,7 +475,7 @@ export default {
|
|
|
475
475
|
type: 'func',
|
|
476
476
|
josi: [['を', 'から']],
|
|
477
477
|
pure: true,
|
|
478
|
-
fn: function(s: string,
|
|
478
|
+
fn: function(s: string, _sys: NakoSystem) {
|
|
479
479
|
const buf = fs.readFileSync(s)
|
|
480
480
|
const text = iconv.decode(Buffer.from(buf), 'euc-jp')
|
|
481
481
|
return text
|
|
@@ -485,7 +485,7 @@ export default {
|
|
|
485
485
|
type: 'func',
|
|
486
486
|
josi: [['を'], ['へ', 'に']],
|
|
487
487
|
pure: true,
|
|
488
|
-
fn: function(s: string, f: string,
|
|
488
|
+
fn: function(s: string, f: string, _sys: NakoSystem) {
|
|
489
489
|
const buf = iconv.encode(s, 'euc-jp')
|
|
490
490
|
fs.writeFileSync(f, buf)
|
|
491
491
|
},
|
|
@@ -549,7 +549,7 @@ export default {
|
|
|
549
549
|
type: 'func',
|
|
550
550
|
josi: [['で'], ['を']],
|
|
551
551
|
pure: true,
|
|
552
|
-
fn: function(callback: any, s: string,
|
|
552
|
+
fn: function(callback: any, s: string, _sys: NakoSystem) {
|
|
553
553
|
exec(s, (err, stdout, stderr) => {
|
|
554
554
|
if (err) { throw new Error(stderr) } else { callback(stdout) }
|
|
555
555
|
})
|
|
@@ -642,8 +642,8 @@ export default {
|
|
|
642
642
|
let st: fs.Stats
|
|
643
643
|
try {
|
|
644
644
|
st = fs.statSync(fullpath)
|
|
645
|
-
|
|
646
|
-
} catch
|
|
645
|
+
|
|
646
|
+
} catch {
|
|
647
647
|
continue
|
|
648
648
|
}
|
|
649
649
|
if (st.isDirectory()) {
|
|
@@ -713,7 +713,7 @@ export default {
|
|
|
713
713
|
type: 'func',
|
|
714
714
|
josi: [['で'], ['から', 'を'], ['に', 'へ']],
|
|
715
715
|
pure: true,
|
|
716
|
-
fn: function(callback: any, a: string, b: string,
|
|
716
|
+
fn: function(callback: any, a: string, b: string, _sys: NakoSystem) {
|
|
717
717
|
return fse.copy(a, b, (err: any) => {
|
|
718
718
|
if (err) { throw new Error('ファイルコピー時:' + err) }
|
|
719
719
|
callback()
|
|
@@ -778,7 +778,7 @@ export default {
|
|
|
778
778
|
type: 'func',
|
|
779
779
|
josi: [['で'], ['から', 'を'], ['に', 'へ']],
|
|
780
780
|
pure: true,
|
|
781
|
-
fn: function(callback: any, a: string, b: string,
|
|
781
|
+
fn: function(callback: any, a: string, b: string, _sys: NakoSystem) {
|
|
782
782
|
fse.move(a, b, (err: any) => {
|
|
783
783
|
if (err) { throw new Error('ファイル移動時:' + err) }
|
|
784
784
|
callback()
|
|
@@ -790,7 +790,7 @@ export default {
|
|
|
790
790
|
type: 'func',
|
|
791
791
|
josi: [['の', 'を']],
|
|
792
792
|
pure: true,
|
|
793
|
-
fn: function(path: string,
|
|
793
|
+
fn: function(path: string, _sys: NakoSystem) {
|
|
794
794
|
return fse.removeSync(path)
|
|
795
795
|
}
|
|
796
796
|
},
|
|
@@ -798,7 +798,7 @@ export default {
|
|
|
798
798
|
type: 'func',
|
|
799
799
|
josi: [['で'], ['の', 'を']],
|
|
800
800
|
pure: true,
|
|
801
|
-
fn: function(callback: any, path: string,
|
|
801
|
+
fn: function(callback: any, path: string, _sys: NakoSystem) {
|
|
802
802
|
return fse.remove(path, (err: any) => {
|
|
803
803
|
if (err) { throw new Error('ファイル削除時:' + err) }
|
|
804
804
|
callback()
|
|
@@ -810,7 +810,7 @@ export default {
|
|
|
810
810
|
type: 'func',
|
|
811
811
|
josi: [['の', 'から']],
|
|
812
812
|
pure: true,
|
|
813
|
-
fn: function(path: string,
|
|
813
|
+
fn: function(path: string, _sys: NakoSystem) {
|
|
814
814
|
return fs.statSync(path)
|
|
815
815
|
}
|
|
816
816
|
},
|
|
@@ -818,7 +818,7 @@ export default {
|
|
|
818
818
|
type: 'func',
|
|
819
819
|
josi: [['の', 'から']],
|
|
820
820
|
pure: true,
|
|
821
|
-
fn: function(path: string,
|
|
821
|
+
fn: function(path: string, _sys: NakoSystem) {
|
|
822
822
|
const st = fs.statSync(path)
|
|
823
823
|
if (!st) { return -1 }
|
|
824
824
|
return st.size
|
|
@@ -933,7 +933,7 @@ export default {
|
|
|
933
933
|
type: 'func',
|
|
934
934
|
josi: [],
|
|
935
935
|
pure: true,
|
|
936
|
-
fn: function(
|
|
936
|
+
fn: function(_sys: NakoSystem) {
|
|
937
937
|
// 環境変数からテンポラリフォルダを取得
|
|
938
938
|
return os.tmpdir()
|
|
939
939
|
}
|
|
@@ -942,7 +942,7 @@ export default {
|
|
|
942
942
|
type: 'func',
|
|
943
943
|
josi: [['に', 'へ']],
|
|
944
944
|
pure: true,
|
|
945
|
-
fn: function(dir: string,
|
|
945
|
+
fn: function(dir: string, _sys: NakoSystem) {
|
|
946
946
|
if (dir === '' || !dir) {
|
|
947
947
|
dir = os.tmpdir()
|
|
948
948
|
}
|
|
@@ -1001,7 +1001,7 @@ export default {
|
|
|
1001
1001
|
b = sys.tags.__quotePath(b)
|
|
1002
1002
|
const cmd = `${tpath} x ${a} -o${b} -y`
|
|
1003
1003
|
|
|
1004
|
-
exec(cmd, (err, stdout,
|
|
1004
|
+
exec(cmd, (err, stdout, _stderr) => {
|
|
1005
1005
|
if (err) { throw new Error('[エラー]『解凍時』' + (err as unknown as string)) }
|
|
1006
1006
|
callback(stdout)
|
|
1007
1007
|
})
|
|
@@ -1031,7 +1031,7 @@ export default {
|
|
|
1031
1031
|
b = sys.tags.__quotePath(b)
|
|
1032
1032
|
const cmd = `${tpath} a -r ${b} ${a} -y`
|
|
1033
1033
|
|
|
1034
|
-
exec(cmd, (err, stdout,
|
|
1034
|
+
exec(cmd, (err, stdout, _stderr) => {
|
|
1035
1035
|
if (err) { throw new Error('[エラー]『圧縮時』' + (err.message || JSON.stringify(err))) }
|
|
1036
1036
|
callback(stdout)
|
|
1037
1037
|
})
|
|
@@ -1057,7 +1057,7 @@ export default {
|
|
|
1057
1057
|
func = sys.__findFunc(func, '強制終了時')
|
|
1058
1058
|
}
|
|
1059
1059
|
|
|
1060
|
-
nodeProcess.on('SIGINT', (
|
|
1060
|
+
nodeProcess.on('SIGINT', (_signal: any) => {
|
|
1061
1061
|
const flag = func(sys)
|
|
1062
1062
|
if (flag) { nodeProcess.exit() }
|
|
1063
1063
|
})
|
|
@@ -1077,7 +1077,7 @@ export default {
|
|
|
1077
1077
|
type: 'func',
|
|
1078
1078
|
josi: [],
|
|
1079
1079
|
pure: true,
|
|
1080
|
-
fn: function(
|
|
1080
|
+
fn: function(_sys: NakoSystem) {
|
|
1081
1081
|
return nodeProcess.platform
|
|
1082
1082
|
}
|
|
1083
1083
|
},
|
|
@@ -1085,7 +1085,7 @@ export default {
|
|
|
1085
1085
|
type: 'func',
|
|
1086
1086
|
josi: [],
|
|
1087
1087
|
pure: true,
|
|
1088
|
-
fn: function(
|
|
1088
|
+
fn: function(_sys: NakoSystem) {
|
|
1089
1089
|
return nodeProcess.arch
|
|
1090
1090
|
}
|
|
1091
1091
|
},
|
|
@@ -1163,7 +1163,7 @@ export default {
|
|
|
1163
1163
|
type: 'func',
|
|
1164
1164
|
josi: [['と'], ['が']],
|
|
1165
1165
|
pure: true,
|
|
1166
|
-
fn: function(a: any, b: any,
|
|
1166
|
+
fn: function(a: any, b: any, _sys: NakoSystem) {
|
|
1167
1167
|
assert.strictEqual(a, b)
|
|
1168
1168
|
}
|
|
1169
1169
|
},
|
|
@@ -1172,7 +1172,7 @@ export default {
|
|
|
1172
1172
|
type: 'func',
|
|
1173
1173
|
josi: [],
|
|
1174
1174
|
pure: true,
|
|
1175
|
-
fn: function(
|
|
1175
|
+
fn: function(_sys: NakoSystem) {
|
|
1176
1176
|
const nif = os.networkInterfaces()
|
|
1177
1177
|
if (!nif) { throw new Error('『自分IPアドレス取得』でネットワークのインターフェイスが種畜できません。') }
|
|
1178
1178
|
/**
|
|
@@ -1194,7 +1194,7 @@ export default {
|
|
|
1194
1194
|
type: 'func',
|
|
1195
1195
|
josi: [],
|
|
1196
1196
|
pure: true,
|
|
1197
|
-
fn: function(
|
|
1197
|
+
fn: function(_sys: NakoSystem) {
|
|
1198
1198
|
const nif = os.networkInterfaces()
|
|
1199
1199
|
if (!nif) { throw new Error('『自分IPアドレス取得』でネットワークのインターフェイスが種畜できません。') }
|
|
1200
1200
|
const result: string[] = []
|
|
@@ -1353,7 +1353,7 @@ export default {
|
|
|
1353
1353
|
type: 'func',
|
|
1354
1354
|
josi: [['まで', 'へ', 'に'], ['を']],
|
|
1355
1355
|
pure: true,
|
|
1356
|
-
fn: function(url: string, params: [key: string],
|
|
1356
|
+
fn: function(url: string, params: [key: string], _sys: NakoSystem) {
|
|
1357
1357
|
const flist: Array<string> = []
|
|
1358
1358
|
|
|
1359
1359
|
for (const key in params) {
|
|
@@ -1377,7 +1377,7 @@ export default {
|
|
|
1377
1377
|
type: 'func',
|
|
1378
1378
|
josi: [['まで', 'へ', 'に'], ['を']],
|
|
1379
1379
|
pure: true,
|
|
1380
|
-
fn: function(url: string, params: any,
|
|
1380
|
+
fn: function(url: string, params: any, _sys: NakoSystem) {
|
|
1381
1381
|
const fd = new FormData()
|
|
1382
1382
|
for (const key in params) { fd.set(key, params[key]) }
|
|
1383
1383
|
|
|
@@ -1393,7 +1393,7 @@ export default {
|
|
|
1393
1393
|
type: 'func',
|
|
1394
1394
|
josi: [['から'], ['で']],
|
|
1395
1395
|
pure: true,
|
|
1396
|
-
fn: function(res: any, type: string,
|
|
1396
|
+
fn: function(res: any, type: string, _sys: NakoSystem) {
|
|
1397
1397
|
type = type.toString().toUpperCase()
|
|
1398
1398
|
if (type === 'TEXT' || type === 'テキスト') {
|
|
1399
1399
|
return res.text()
|
|
@@ -1440,7 +1440,7 @@ export default {
|
|
|
1440
1440
|
type: 'func',
|
|
1441
1441
|
josi: [['の', 'を']],
|
|
1442
1442
|
pure: true,
|
|
1443
|
-
fn: function(params: any,
|
|
1443
|
+
fn: function(params: any, _sys: NakoSystem) {
|
|
1444
1444
|
const flist: Array<string> = []
|
|
1445
1445
|
for (const key in params) {
|
|
1446
1446
|
const v = params[key]
|
|
@@ -1480,7 +1480,7 @@ export default {
|
|
|
1480
1480
|
josi: [['まで', 'へ', 'に'], ['を']],
|
|
1481
1481
|
pure: true,
|
|
1482
1482
|
asyncFn: true,
|
|
1483
|
-
fn: function(url: any, params: any,
|
|
1483
|
+
fn: function(url: any, params: any, _sys: any) {
|
|
1484
1484
|
return new Promise((resolve, reject) => {
|
|
1485
1485
|
const fd = new FormData()
|
|
1486
1486
|
for (const key in params) { fd.set(key, params[key]) }
|
|
@@ -1553,7 +1553,7 @@ export default {
|
|
|
1553
1553
|
josi: [['へ', 'に'], ['を']],
|
|
1554
1554
|
pure: true,
|
|
1555
1555
|
asyncFn: true,
|
|
1556
|
-
fn: async function(url: string, s: string,
|
|
1556
|
+
fn: async function(url: string, s: string, _sys: NakoSystem) {
|
|
1557
1557
|
const payload = { content: s }
|
|
1558
1558
|
const res = await fetch(url, {
|
|
1559
1559
|
method: 'POST',
|
|
@@ -1573,7 +1573,7 @@ export default {
|
|
|
1573
1573
|
josi: [['へ', 'に'], ['と'], ['を']],
|
|
1574
1574
|
pure: true,
|
|
1575
1575
|
asyncFn: true,
|
|
1576
|
-
fn: async function(url: string, f: string, s: string,
|
|
1576
|
+
fn: async function(url: string, f: string, s: string, _sys: NakoSystem) {
|
|
1577
1577
|
const formData = new FormData()
|
|
1578
1578
|
formData.append('content', s)
|
|
1579
1579
|
const imageData = fs.readFileSync(f)
|
|
@@ -1596,7 +1596,7 @@ export default {
|
|
|
1596
1596
|
type: 'func',
|
|
1597
1597
|
josi: [['へ', 'に'], ['を']],
|
|
1598
1598
|
pure: true,
|
|
1599
|
-
fn: function(
|
|
1599
|
+
fn: function(_token: string, _message: string, _sys: NakoSystem) {
|
|
1600
1600
|
throw new Error('『LINE送信』は2025年4月で使えなくなりました。[詳細URL] https://nadesi.com/v3/doc/go.php?4670')
|
|
1601
1601
|
}
|
|
1602
1602
|
},
|
|
@@ -1604,7 +1604,7 @@ export default {
|
|
|
1604
1604
|
type: 'func',
|
|
1605
1605
|
josi: [['へ', 'に'], ['と'], ['を']],
|
|
1606
1606
|
pure: true,
|
|
1607
|
-
fn: function(
|
|
1607
|
+
fn: function(_token: string, _imageFile: string, _message: string, _sys: NakoSystem) {
|
|
1608
1608
|
throw new Error('『LINE画像送信』は2025年4月で使えなくなりました。[詳細URL] https://nadesi.com/v3/doc/go.php?4670')
|
|
1609
1609
|
}
|
|
1610
1610
|
},
|
|
@@ -1613,7 +1613,7 @@ export default {
|
|
|
1613
1613
|
type: 'func',
|
|
1614
1614
|
josi: [['の', 'を']],
|
|
1615
1615
|
pure: true,
|
|
1616
|
-
fn: function(code: string,
|
|
1616
|
+
fn: function(code: string, _sys: NakoSystem) {
|
|
1617
1617
|
return iconv.encodingExists(code)
|
|
1618
1618
|
}
|
|
1619
1619
|
},
|
|
@@ -1621,7 +1621,7 @@ export default {
|
|
|
1621
1621
|
type: 'func',
|
|
1622
1622
|
josi: [['に', 'へ', 'を']],
|
|
1623
1623
|
pure: true,
|
|
1624
|
-
fn: function(str: string,
|
|
1624
|
+
fn: function(str: string, _sys: NakoSystem) {
|
|
1625
1625
|
// iconv.skipDecodeWarning = true
|
|
1626
1626
|
return iconv.encode(str, 'Shift_JIS')
|
|
1627
1627
|
}
|
|
@@ -1630,7 +1630,7 @@ export default {
|
|
|
1630
1630
|
type: 'func',
|
|
1631
1631
|
josi: [['から', 'を', 'で']],
|
|
1632
1632
|
pure: true,
|
|
1633
|
-
fn: function(buf: any,
|
|
1633
|
+
fn: function(buf: any, _sys: NakoSystem) {
|
|
1634
1634
|
// iconv.skipDecodeWarning = true
|
|
1635
1635
|
return iconv.decode(Buffer.from(buf), 'sjis')
|
|
1636
1636
|
}
|
|
@@ -1639,7 +1639,7 @@ export default {
|
|
|
1639
1639
|
type: 'func',
|
|
1640
1640
|
josi: [['を'], ['へ', 'で']],
|
|
1641
1641
|
pure: true,
|
|
1642
|
-
fn: function(s: string, code: string,
|
|
1642
|
+
fn: function(s: string, code: string, _sys: NakoSystem) {
|
|
1643
1643
|
// iconv.skipDecodeWarning = true
|
|
1644
1644
|
return iconv.encode(s, code)
|
|
1645
1645
|
}
|
|
@@ -1648,7 +1648,7 @@ export default {
|
|
|
1648
1648
|
type: 'func',
|
|
1649
1649
|
josi: [['を'], ['から', 'で']],
|
|
1650
1650
|
pure: true,
|
|
1651
|
-
fn: function(buf: any, code: string,
|
|
1651
|
+
fn: function(buf: any, code: string, _sys: NakoSystem) {
|
|
1652
1652
|
// iconv.skipDecodeWarning = true
|
|
1653
1653
|
return iconv.decode(Buffer.from(buf), code)
|
|
1654
1654
|
}
|
|
@@ -1658,7 +1658,7 @@ export default {
|
|
|
1658
1658
|
type: 'func',
|
|
1659
1659
|
josi: [],
|
|
1660
1660
|
pure: true,
|
|
1661
|
-
fn: function(
|
|
1661
|
+
fn: function(_sys: NakoSystem) {
|
|
1662
1662
|
return crypto.getHashes()
|
|
1663
1663
|
}
|
|
1664
1664
|
},
|
|
@@ -1666,7 +1666,7 @@ export default {
|
|
|
1666
1666
|
type: 'func',
|
|
1667
1667
|
josi: [['を'], ['の'], ['で']],
|
|
1668
1668
|
pure: true,
|
|
1669
|
-
fn: function(s: any, alg: string, enc: any,
|
|
1669
|
+
fn: function(s: any, alg: string, enc: any, _sys: NakoSystem) {
|
|
1670
1670
|
const hashsum = crypto.createHash(alg)
|
|
1671
1671
|
hashsum.update(s)
|
|
1672
1672
|
return hashsum.digest(enc)
|
|
@@ -1676,7 +1676,7 @@ export default {
|
|
|
1676
1676
|
type: 'func',
|
|
1677
1677
|
josi: [],
|
|
1678
1678
|
pure: true,
|
|
1679
|
-
fn: function(
|
|
1679
|
+
fn: function(_sys: NakoSystem) {
|
|
1680
1680
|
const uuid = crypto.randomUUID()
|
|
1681
1681
|
return uuid
|
|
1682
1682
|
}
|
|
@@ -1685,7 +1685,7 @@ export default {
|
|
|
1685
1685
|
type: 'func',
|
|
1686
1686
|
josi: [['の']],
|
|
1687
1687
|
pure: true,
|
|
1688
|
-
fn: function(cnt: number,
|
|
1688
|
+
fn: function(cnt: number, _sys: NakoSystem) {
|
|
1689
1689
|
const a = new Uint8Array(cnt)
|
|
1690
1690
|
crypto.getRandomValues(a)
|
|
1691
1691
|
return a
|