crash-js 0.1.58 → 0.1.62
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/crash-js/crash-js +5 -4
- package/crash-js/fs-utils +115 -60
- package/crash-js/utils +10 -15
- package/package.json +7 -3
package/crash-js/crash-js
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
// ----------------------------------------------------------------------
|
|
10
10
|
//
|
|
11
11
|
// This program is free software: you can redistribute it and/or modify
|
|
12
|
-
// it under the terms of the GNU Affero General Public License as
|
|
13
|
-
// the Free Software Foundation, either version 3 of
|
|
14
|
-
// (at your option) any later version.
|
|
12
|
+
// it under the terms of the GNU Affero General Public License as
|
|
13
|
+
// published by the Free Software Foundation, either version 3 of
|
|
14
|
+
// the License, or (at your option) any later version.
|
|
15
15
|
//
|
|
16
16
|
// This program is distributed in the hope that it will be useful,
|
|
17
17
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
@@ -42,7 +42,6 @@ const
|
|
|
42
42
|
_basename =
|
|
43
43
|
_fs_utils._basename;
|
|
44
44
|
|
|
45
|
-
|
|
46
45
|
function
|
|
47
46
|
_app_name_get() {
|
|
48
47
|
let
|
|
@@ -293,6 +292,8 @@ module.exports = {
|
|
|
293
292
|
_printf,
|
|
294
293
|
_sleep:
|
|
295
294
|
_sleep,
|
|
295
|
+
_split:
|
|
296
|
+
_fs_utils._split,
|
|
296
297
|
_yargv_get:
|
|
297
298
|
_yargv_get
|
|
298
299
|
};
|
package/crash-js/fs-utils
CHANGED
|
@@ -31,20 +31,67 @@ function
|
|
|
31
31
|
_fs =
|
|
32
32
|
require(
|
|
33
33
|
"fs");
|
|
34
|
-
_path_module =
|
|
35
|
-
require("path");
|
|
36
34
|
}
|
|
37
35
|
else {
|
|
38
36
|
_fs =
|
|
39
37
|
require("happy-opfs");
|
|
40
|
-
_path_module =
|
|
41
|
-
require("@std/path");
|
|
42
38
|
}
|
|
43
39
|
return _fs;
|
|
44
40
|
}
|
|
41
|
+
|
|
42
|
+
function
|
|
43
|
+
_path_module_get() {
|
|
44
|
+
let
|
|
45
|
+
_path;
|
|
46
|
+
if ( typeof window === 'undefined' &&
|
|
47
|
+
( typeof global !== 'undefined' && global.global === global ) &&
|
|
48
|
+
typeof __webpack_require__ !== 'function' ) {
|
|
49
|
+
_path =
|
|
50
|
+
require("path");
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
_path =
|
|
54
|
+
require("@std/path");
|
|
55
|
+
}
|
|
56
|
+
return _path;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function
|
|
60
|
+
_split_opfs() {
|
|
61
|
+
console.log(
|
|
62
|
+
"hello");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function
|
|
66
|
+
_split_module_get() {
|
|
67
|
+
let
|
|
68
|
+
_split;
|
|
69
|
+
if ( typeof window === 'undefined' &&
|
|
70
|
+
( typeof global !== 'undefined' && global.global === global ) &&
|
|
71
|
+
typeof __webpack_require__ !== 'function' ) {
|
|
72
|
+
_split =
|
|
73
|
+
require(
|
|
74
|
+
"split-file");
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
_split =
|
|
78
|
+
_split_opfs;
|
|
79
|
+
}
|
|
80
|
+
return _split;
|
|
81
|
+
}
|
|
82
|
+
|
|
45
83
|
const
|
|
46
84
|
_fs =
|
|
47
85
|
_fs_module_get();
|
|
86
|
+
const
|
|
87
|
+
_json_parse =
|
|
88
|
+
JSON.parse;
|
|
89
|
+
const
|
|
90
|
+
_json_display =
|
|
91
|
+
JSON.stringify;
|
|
92
|
+
const
|
|
93
|
+
_path_module =
|
|
94
|
+
_path_module_get();
|
|
48
95
|
_path_module_basename =
|
|
49
96
|
_path_module.basename;
|
|
50
97
|
_path_module_dirname =
|
|
@@ -54,11 +101,8 @@ _path_module_join =
|
|
|
54
101
|
_path_module_parse =
|
|
55
102
|
_path_module.parse;
|
|
56
103
|
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
_json_display =
|
|
61
|
-
JSON.stringify;
|
|
104
|
+
_split_module =
|
|
105
|
+
_split_module_get();
|
|
62
106
|
|
|
63
107
|
function
|
|
64
108
|
_basename(
|
|
@@ -82,6 +126,26 @@ function
|
|
|
82
126
|
return _dir;
|
|
83
127
|
}
|
|
84
128
|
|
|
129
|
+
function
|
|
130
|
+
_ext_rm(
|
|
131
|
+
_path) {
|
|
132
|
+
let
|
|
133
|
+
_dir,
|
|
134
|
+
_name,
|
|
135
|
+
_paths;
|
|
136
|
+
_dir =
|
|
137
|
+
_path_module_parse(
|
|
138
|
+
_path).dir;
|
|
139
|
+
_name =
|
|
140
|
+
_path_module_parse(
|
|
141
|
+
_path).name;
|
|
142
|
+
_paths = [
|
|
143
|
+
_dir,
|
|
144
|
+
_name];
|
|
145
|
+
return _path_join(
|
|
146
|
+
_paths);
|
|
147
|
+
}
|
|
148
|
+
|
|
85
149
|
function
|
|
86
150
|
_file_exists(
|
|
87
151
|
_path) {
|
|
@@ -127,53 +191,6 @@ function
|
|
|
127
191
|
_content);
|
|
128
192
|
}
|
|
129
193
|
|
|
130
|
-
function
|
|
131
|
-
_path_join(
|
|
132
|
-
_paths) {
|
|
133
|
-
let
|
|
134
|
-
_path;
|
|
135
|
-
_path =
|
|
136
|
-
_path_module_join.apply(
|
|
137
|
-
null,
|
|
138
|
-
_paths);
|
|
139
|
-
return _path;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
function
|
|
143
|
-
_ext_rm(
|
|
144
|
-
_path) {
|
|
145
|
-
let
|
|
146
|
-
_dir,
|
|
147
|
-
_name,
|
|
148
|
-
_paths;
|
|
149
|
-
_dir =
|
|
150
|
-
_path_module_parse(
|
|
151
|
-
_path).dir;
|
|
152
|
-
_name =
|
|
153
|
-
_path_module_parse(
|
|
154
|
-
_path).name;
|
|
155
|
-
_paths = [
|
|
156
|
-
_dir,
|
|
157
|
-
_name];
|
|
158
|
-
return _path_join(
|
|
159
|
-
_paths);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function
|
|
163
|
-
_json_read(
|
|
164
|
-
_json_path) {
|
|
165
|
-
let
|
|
166
|
-
_json_str,
|
|
167
|
-
_json;
|
|
168
|
-
_json_str =
|
|
169
|
-
_file_read(
|
|
170
|
-
_json_path);
|
|
171
|
-
_json =
|
|
172
|
-
_json_parse(
|
|
173
|
-
_json_str);
|
|
174
|
-
return _json;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
194
|
function
|
|
178
195
|
_fs_worker_new(
|
|
179
196
|
_url) {
|
|
@@ -234,6 +251,42 @@ async function
|
|
|
234
251
|
return _agent;
|
|
235
252
|
}
|
|
236
253
|
|
|
254
|
+
function
|
|
255
|
+
_json_read(
|
|
256
|
+
_json_path) {
|
|
257
|
+
let
|
|
258
|
+
_json_str,
|
|
259
|
+
_json;
|
|
260
|
+
_json_str =
|
|
261
|
+
_file_read(
|
|
262
|
+
_json_path);
|
|
263
|
+
_json =
|
|
264
|
+
_json_parse(
|
|
265
|
+
_json_str);
|
|
266
|
+
return _json;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function
|
|
270
|
+
_path_join(
|
|
271
|
+
_paths) {
|
|
272
|
+
let
|
|
273
|
+
_path;
|
|
274
|
+
_path =
|
|
275
|
+
_path_module_join.apply(
|
|
276
|
+
null,
|
|
277
|
+
_paths);
|
|
278
|
+
return _path;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function
|
|
282
|
+
_split(
|
|
283
|
+
_in,
|
|
284
|
+
_parts,
|
|
285
|
+
_out) {
|
|
286
|
+
console.log(
|
|
287
|
+
_split_module);
|
|
288
|
+
}
|
|
289
|
+
|
|
237
290
|
module.exports = {
|
|
238
291
|
_basename:
|
|
239
292
|
_basename,
|
|
@@ -251,14 +304,16 @@ module.exports = {
|
|
|
251
304
|
_fs_worker_new,
|
|
252
305
|
_fs_worker_start:
|
|
253
306
|
_fs_worker_start,
|
|
307
|
+
_json_display:
|
|
308
|
+
_json_display,
|
|
309
|
+
_json_read:
|
|
310
|
+
_json_read,
|
|
254
311
|
_ls:
|
|
255
312
|
_fs.readDirSync,
|
|
256
313
|
_mkdir:
|
|
257
314
|
_fs.mkdirSync,
|
|
258
315
|
_path_join:
|
|
259
316
|
_path_join,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
_json_read:
|
|
263
|
-
_json_read
|
|
317
|
+
_split:
|
|
318
|
+
_split
|
|
264
319
|
};
|
package/crash-js/utils
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
4
|
|
|
5
|
-
//
|
|
5
|
+
// -----------------------------------------------------------------------
|
|
6
6
|
// Copyright © 2024, 2025 Pellegrino Prevete
|
|
7
7
|
//
|
|
8
8
|
// All rights reserved
|
|
9
|
-
//
|
|
9
|
+
// -----------------------------------------------------------------------
|
|
10
10
|
//
|
|
11
|
-
// This program is free software: you can redistribute it and/or modify
|
|
12
|
-
// it under the terms of the GNU Affero General Public License as
|
|
13
|
-
// the Free Software Foundation, either version 3 of the
|
|
14
|
-
// (at your option) any later version.
|
|
11
|
+
// This program is free software: you can redistribute it and/or modify it
|
|
12
|
+
// it under the terms of the GNU Affero General Public License as
|
|
13
|
+
// published by the Free Software Foundation, either version 3 of the
|
|
14
|
+
// License, or (at your option) any later version.
|
|
15
15
|
//
|
|
16
16
|
// This program is distributed in the hope that it will be useful,
|
|
17
17
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
@@ -21,8 +21,6 @@
|
|
|
21
21
|
// You should have received a copy of the GNU Affero General Public License
|
|
22
22
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
24
|
function
|
|
27
25
|
_argv_url_get(
|
|
28
26
|
_key_name) {
|
|
@@ -104,18 +102,15 @@ function
|
|
|
104
102
|
_argv,
|
|
105
103
|
_hide_bin,
|
|
106
104
|
_yargs,
|
|
107
|
-
_yargs_module,
|
|
108
105
|
_yargs_object;
|
|
109
106
|
if ( typeof window === 'undefined' &&
|
|
110
107
|
( typeof global !== 'undefined' && global.global === global ) ) {
|
|
111
|
-
|
|
108
|
+
_yargs =
|
|
112
109
|
require(
|
|
113
110
|
"yargs");
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
require(
|
|
118
|
-
"yargs/helpers");
|
|
111
|
+
_yargs_helpers_module =
|
|
112
|
+
require(
|
|
113
|
+
"yargs/helpers");
|
|
119
114
|
_hide_bin =
|
|
120
115
|
_yargs_helpers_module.hideBin;
|
|
121
116
|
_yargs_object =
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name":
|
|
3
3
|
"crash-js",
|
|
4
4
|
"version":
|
|
5
|
-
"0.1.
|
|
5
|
+
"0.1.62",
|
|
6
6
|
"description":
|
|
7
7
|
"Crash Javascript library.",
|
|
8
8
|
"funding":
|
|
@@ -58,10 +58,14 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"buffer":
|
|
60
60
|
"^6.0.3",
|
|
61
|
-
"
|
|
62
|
-
"npm:@themartiancompany/
|
|
61
|
+
"opfs":
|
|
62
|
+
"npm:@themartiancompany/opfs@^1.8.11",
|
|
63
|
+
"split-file":
|
|
64
|
+
"^2.3.0",
|
|
63
65
|
"stream-browserify":
|
|
64
66
|
"^3.0.0",
|
|
67
|
+
"web-worker":
|
|
68
|
+
"1.5.0",
|
|
65
69
|
"yargs":
|
|
66
70
|
"18.0.0"
|
|
67
71
|
},
|