mol_jsx_lib 0.0.704 → 0.0.706
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/node.deps.json +1 -1
- package/node.js +15 -5
- package/node.js.map +1 -1
- package/node.mjs +15 -5
- package/node.test.js +64 -67
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +33 -33
- package/web.deps.json +1 -1
- package/web.js +67 -57
- package/web.js.map +1 -1
- package/web.mjs +67 -57
- package/web.test.js +44 -57
- package/web.test.js.map +1 -1
package/web.mjs
CHANGED
|
@@ -1269,6 +1269,62 @@ var $;
|
|
|
1269
1269
|
;
|
|
1270
1270
|
"use strict";
|
|
1271
1271
|
var $;
|
|
1272
|
+
(function ($) {
|
|
1273
|
+
function $mol_log3_area_lazy(event) {
|
|
1274
|
+
const self = this;
|
|
1275
|
+
const stack = self.$mol_log3_stack;
|
|
1276
|
+
const deep = stack.length;
|
|
1277
|
+
let logged = false;
|
|
1278
|
+
stack.push(() => {
|
|
1279
|
+
logged = true;
|
|
1280
|
+
self.$mol_log3_area.call(self, event);
|
|
1281
|
+
});
|
|
1282
|
+
return () => {
|
|
1283
|
+
if (logged)
|
|
1284
|
+
self.console.groupEnd();
|
|
1285
|
+
if (stack.length > deep)
|
|
1286
|
+
stack.length = deep;
|
|
1287
|
+
};
|
|
1288
|
+
}
|
|
1289
|
+
$.$mol_log3_area_lazy = $mol_log3_area_lazy;
|
|
1290
|
+
$.$mol_log3_stack = [];
|
|
1291
|
+
})($ || ($ = {}));
|
|
1292
|
+
//mol/log3/log3.ts
|
|
1293
|
+
;
|
|
1294
|
+
"use strict";
|
|
1295
|
+
//mol/type/keys/extract/extract.ts
|
|
1296
|
+
;
|
|
1297
|
+
"use strict";
|
|
1298
|
+
var $;
|
|
1299
|
+
(function ($) {
|
|
1300
|
+
function $mol_log3_web_make(level, color) {
|
|
1301
|
+
return function $mol_log3_logger(event) {
|
|
1302
|
+
const pending = this.$mol_log3_stack.pop();
|
|
1303
|
+
if (pending)
|
|
1304
|
+
pending();
|
|
1305
|
+
let tpl = '%c';
|
|
1306
|
+
const chunks = Object.values(event);
|
|
1307
|
+
for (let i = 0; i < chunks.length; ++i) {
|
|
1308
|
+
tpl += (typeof chunks[i] === 'string') ? ' ▫ %s' : ' ▫ %o';
|
|
1309
|
+
}
|
|
1310
|
+
const style = `color:${color};font-weight:bolder`;
|
|
1311
|
+
this.console[level](tpl, style, ...chunks);
|
|
1312
|
+
const self = this;
|
|
1313
|
+
return () => self.console.groupEnd();
|
|
1314
|
+
};
|
|
1315
|
+
}
|
|
1316
|
+
$.$mol_log3_web_make = $mol_log3_web_make;
|
|
1317
|
+
$.$mol_log3_come = $mol_log3_web_make('info', 'royalblue');
|
|
1318
|
+
$.$mol_log3_done = $mol_log3_web_make('info', 'forestgreen');
|
|
1319
|
+
$.$mol_log3_fail = $mol_log3_web_make('error', 'orangered');
|
|
1320
|
+
$.$mol_log3_warn = $mol_log3_web_make('warn', 'goldenrod');
|
|
1321
|
+
$.$mol_log3_rise = $mol_log3_web_make('log', 'magenta');
|
|
1322
|
+
$.$mol_log3_area = $mol_log3_web_make('group', 'cyan');
|
|
1323
|
+
})($ || ($ = {}));
|
|
1324
|
+
//mol/log3/log3.web.ts
|
|
1325
|
+
;
|
|
1326
|
+
"use strict";
|
|
1327
|
+
var $;
|
|
1272
1328
|
(function ($) {
|
|
1273
1329
|
class $mol_wire_task extends $mol_wire_fiber {
|
|
1274
1330
|
static getter(task) {
|
|
@@ -1286,7 +1342,17 @@ var $;
|
|
|
1286
1342
|
break reuse;
|
|
1287
1343
|
return existen;
|
|
1288
1344
|
}
|
|
1289
|
-
|
|
1345
|
+
const next = new $mol_wire_task(`${host?.[Symbol.toStringTag] ?? host}.${task.name}(#)`, task, host, args);
|
|
1346
|
+
if (existen?.temp) {
|
|
1347
|
+
$$.$mol_log3_warn({
|
|
1348
|
+
place: '$mol_wire_task',
|
|
1349
|
+
message: `Non idempotency`,
|
|
1350
|
+
existen,
|
|
1351
|
+
next,
|
|
1352
|
+
hint: 'Ignore it',
|
|
1353
|
+
});
|
|
1354
|
+
}
|
|
1355
|
+
return next;
|
|
1290
1356
|
};
|
|
1291
1357
|
}
|
|
1292
1358
|
get temp() {
|
|
@@ -2116,62 +2182,6 @@ var $;
|
|
|
2116
2182
|
;
|
|
2117
2183
|
"use strict";
|
|
2118
2184
|
var $;
|
|
2119
|
-
(function ($) {
|
|
2120
|
-
function $mol_log3_area_lazy(event) {
|
|
2121
|
-
const self = this;
|
|
2122
|
-
const stack = self.$mol_log3_stack;
|
|
2123
|
-
const deep = stack.length;
|
|
2124
|
-
let logged = false;
|
|
2125
|
-
stack.push(() => {
|
|
2126
|
-
logged = true;
|
|
2127
|
-
self.$mol_log3_area.call(self, event);
|
|
2128
|
-
});
|
|
2129
|
-
return () => {
|
|
2130
|
-
if (logged)
|
|
2131
|
-
self.console.groupEnd();
|
|
2132
|
-
if (stack.length > deep)
|
|
2133
|
-
stack.length = deep;
|
|
2134
|
-
};
|
|
2135
|
-
}
|
|
2136
|
-
$.$mol_log3_area_lazy = $mol_log3_area_lazy;
|
|
2137
|
-
$.$mol_log3_stack = [];
|
|
2138
|
-
})($ || ($ = {}));
|
|
2139
|
-
//mol/log3/log3.ts
|
|
2140
|
-
;
|
|
2141
|
-
"use strict";
|
|
2142
|
-
//mol/type/keys/extract/extract.ts
|
|
2143
|
-
;
|
|
2144
|
-
"use strict";
|
|
2145
|
-
var $;
|
|
2146
|
-
(function ($) {
|
|
2147
|
-
function $mol_log3_web_make(level, color) {
|
|
2148
|
-
return function $mol_log3_logger(event) {
|
|
2149
|
-
const pending = this.$mol_log3_stack.pop();
|
|
2150
|
-
if (pending)
|
|
2151
|
-
pending();
|
|
2152
|
-
let tpl = '%c';
|
|
2153
|
-
const chunks = Object.values(event);
|
|
2154
|
-
for (let i = 0; i < chunks.length; ++i) {
|
|
2155
|
-
tpl += (typeof chunks[i] === 'string') ? ' ⦙ %s' : ' ⦙ %o';
|
|
2156
|
-
}
|
|
2157
|
-
const style = `color:${color};font-weight:bolder`;
|
|
2158
|
-
this.console[level](tpl, style, ...chunks);
|
|
2159
|
-
const self = this;
|
|
2160
|
-
return () => self.console.groupEnd();
|
|
2161
|
-
};
|
|
2162
|
-
}
|
|
2163
|
-
$.$mol_log3_web_make = $mol_log3_web_make;
|
|
2164
|
-
$.$mol_log3_come = $mol_log3_web_make('info', 'royalblue');
|
|
2165
|
-
$.$mol_log3_done = $mol_log3_web_make('info', 'forestgreen');
|
|
2166
|
-
$.$mol_log3_fail = $mol_log3_web_make('error', 'orangered');
|
|
2167
|
-
$.$mol_log3_warn = $mol_log3_web_make('warn', 'goldenrod');
|
|
2168
|
-
$.$mol_log3_rise = $mol_log3_web_make('log', 'magenta');
|
|
2169
|
-
$.$mol_log3_area = $mol_log3_web_make('group', 'cyan');
|
|
2170
|
-
})($ || ($ = {}));
|
|
2171
|
-
//mol/log3/log3.web.ts
|
|
2172
|
-
;
|
|
2173
|
-
"use strict";
|
|
2174
|
-
var $;
|
|
2175
2185
|
(function ($) {
|
|
2176
2186
|
class $mol_wire_log extends $mol_object2 {
|
|
2177
2187
|
static watch(task) {
|
package/web.test.js
CHANGED
|
@@ -110,17 +110,6 @@ var $;
|
|
|
110
110
|
;
|
|
111
111
|
"use strict";
|
|
112
112
|
var $;
|
|
113
|
-
(function ($) {
|
|
114
|
-
function $mol_dom_serialize(node) {
|
|
115
|
-
const serializer = new $mol_dom_context.XMLSerializer;
|
|
116
|
-
return serializer.serializeToString(node);
|
|
117
|
-
}
|
|
118
|
-
$.$mol_dom_serialize = $mol_dom_serialize;
|
|
119
|
-
})($ || ($ = {}));
|
|
120
|
-
//mol/dom/serialize/serialize.ts
|
|
121
|
-
;
|
|
122
|
-
"use strict";
|
|
123
|
-
var $;
|
|
124
113
|
(function ($) {
|
|
125
114
|
function $mol_assert_ok(value) {
|
|
126
115
|
if (value)
|
|
@@ -141,14 +130,12 @@ var $;
|
|
|
141
130
|
handler();
|
|
142
131
|
}
|
|
143
132
|
catch (error) {
|
|
144
|
-
if (!ErrorRight)
|
|
145
|
-
return error;
|
|
146
133
|
$.$mol_fail = fail;
|
|
147
134
|
if (typeof ErrorRight === 'string') {
|
|
148
135
|
$mol_assert_equal(error.message, ErrorRight);
|
|
149
136
|
}
|
|
150
137
|
else {
|
|
151
|
-
$
|
|
138
|
+
$mol_assert_equal(error instanceof ErrorRight, true);
|
|
152
139
|
}
|
|
153
140
|
return error;
|
|
154
141
|
}
|
|
@@ -158,58 +145,47 @@ var $;
|
|
|
158
145
|
$mol_fail(new Error('Not failed'));
|
|
159
146
|
}
|
|
160
147
|
$.$mol_assert_fail = $mol_assert_fail;
|
|
161
|
-
function $
|
|
162
|
-
|
|
163
|
-
for (let j = 0; j < args.length; ++j) {
|
|
164
|
-
if (i === j)
|
|
165
|
-
continue;
|
|
166
|
-
if (Number.isNaN(args[i]) && Number.isNaN(args[j]))
|
|
167
|
-
continue;
|
|
168
|
-
if (args[i] !== args[j])
|
|
169
|
-
$mol_fail(new Error(`Not equal (${i + 1}:${j + 1})\n${args[i]}\n${args[j]}`));
|
|
170
|
-
}
|
|
171
|
-
}
|
|
148
|
+
function $mol_assert_like(...args) {
|
|
149
|
+
$mol_assert_equal(...args);
|
|
172
150
|
}
|
|
173
|
-
$.$
|
|
151
|
+
$.$mol_assert_like = $mol_assert_like;
|
|
174
152
|
function $mol_assert_unique(...args) {
|
|
175
153
|
for (let i = 0; i < args.length; ++i) {
|
|
176
154
|
for (let j = 0; j < args.length; ++j) {
|
|
177
155
|
if (i === j)
|
|
178
156
|
continue;
|
|
179
|
-
if (
|
|
180
|
-
|
|
181
|
-
}
|
|
157
|
+
if (!$mol_compare_deep(args[i], args[j]))
|
|
158
|
+
continue;
|
|
159
|
+
$mol_fail(new Error(`args[${i}] = args[${j}] = ${args[i]}`));
|
|
182
160
|
}
|
|
183
161
|
}
|
|
184
162
|
}
|
|
185
163
|
$.$mol_assert_unique = $mol_assert_unique;
|
|
186
|
-
function $
|
|
187
|
-
for (let
|
|
188
|
-
if (
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return val;
|
|
194
|
-
if ('outerHTML' in val)
|
|
195
|
-
return val.outerHTML;
|
|
196
|
-
try {
|
|
197
|
-
return JSON.stringify(val, (k, v) => typeof v === 'bigint' ? String(v) : v, '\t');
|
|
198
|
-
}
|
|
199
|
-
catch (error) {
|
|
200
|
-
console.error(error);
|
|
201
|
-
return val;
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
return $mol_fail(new Error(`Not like (1:${+index + 2})\n${print(head)}\n---\n${print(value)}`));
|
|
205
|
-
}
|
|
164
|
+
function $mol_assert_equal(...args) {
|
|
165
|
+
for (let i = 1; i < args.length; ++i) {
|
|
166
|
+
if ($mol_compare_deep(args[0], args[i]))
|
|
167
|
+
continue;
|
|
168
|
+
if (args[0] instanceof Element && args[i] instanceof Element && args[0].outerHTML === args[i].outerHTML)
|
|
169
|
+
continue;
|
|
170
|
+
return $mol_fail(new Error(`args[0] ≠ args[${i}]\n${print(args[0])}\n---\n${print(args[i])}`));
|
|
206
171
|
}
|
|
207
172
|
}
|
|
208
|
-
$.$
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
173
|
+
$.$mol_assert_equal = $mol_assert_equal;
|
|
174
|
+
const print = (val) => {
|
|
175
|
+
if (!val)
|
|
176
|
+
return val;
|
|
177
|
+
if (typeof val !== 'object')
|
|
178
|
+
return val;
|
|
179
|
+
if ('outerHTML' in val)
|
|
180
|
+
return val.outerHTML;
|
|
181
|
+
try {
|
|
182
|
+
return JSON.stringify(val, (k, v) => typeof v === 'bigint' ? String(v) : v, '\t');
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
console.error(error);
|
|
186
|
+
return val;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
213
189
|
})($ || ($ = {}));
|
|
214
190
|
//mol/assert/assert.ts
|
|
215
191
|
;
|
|
@@ -230,10 +206,10 @@ var $;
|
|
|
230
206
|
$mol_assert_equal(2, 2, 2);
|
|
231
207
|
},
|
|
232
208
|
'two must be unique'() {
|
|
233
|
-
$mol_assert_unique([
|
|
209
|
+
$mol_assert_unique([2], [3]);
|
|
234
210
|
},
|
|
235
211
|
'three must be unique'() {
|
|
236
|
-
$mol_assert_unique([
|
|
212
|
+
$mol_assert_unique([1], [2], [3]);
|
|
237
213
|
},
|
|
238
214
|
'two must be alike'() {
|
|
239
215
|
$mol_assert_like([3], [3]);
|
|
@@ -1533,7 +1509,7 @@ var $;
|
|
|
1533
1509
|
], App, "result", null);
|
|
1534
1510
|
$mol_assert_equal(App.result(), 1);
|
|
1535
1511
|
App.condition(true);
|
|
1536
|
-
$mol_assert_fail(() => App.result());
|
|
1512
|
+
$mol_assert_fail(() => App.result(), 'test error');
|
|
1537
1513
|
App.condition(false);
|
|
1538
1514
|
$mol_assert_equal(App.result(), 1);
|
|
1539
1515
|
},
|
|
@@ -1868,6 +1844,17 @@ var $;
|
|
|
1868
1844
|
;
|
|
1869
1845
|
"use strict";
|
|
1870
1846
|
var $;
|
|
1847
|
+
(function ($) {
|
|
1848
|
+
function $mol_dom_serialize(node) {
|
|
1849
|
+
const serializer = new $mol_dom_context.XMLSerializer;
|
|
1850
|
+
return serializer.serializeToString(node);
|
|
1851
|
+
}
|
|
1852
|
+
$.$mol_dom_serialize = $mol_dom_serialize;
|
|
1853
|
+
})($ || ($ = {}));
|
|
1854
|
+
//mol/dom/serialize/serialize.ts
|
|
1855
|
+
;
|
|
1856
|
+
"use strict";
|
|
1857
|
+
var $;
|
|
1871
1858
|
(function ($_1) {
|
|
1872
1859
|
$mol_test({
|
|
1873
1860
|
'Class as component'() {
|