mol_crypto_lib 0.0.346 → 0.0.349
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.test.js +159 -114
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.deps.json +1 -1
- package/web.test.js +2 -2
- package/web.test.js.map +1 -1
package/node.deps.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"files":["LICENSE","README.md","lang.lang.tree","mam.jam.js","mam.ts","package.json","sandbox.config.json","tsconfig.json","tsfmt.json","yarn.lock","mol/CNAME","mol/CODE_OF_CONDUCT.md","mol/CONTRIBUTING.md","mol/LICENSE","mol/index.html","mol/mol.meta.tree","mol/readme.md","mol/crypto/README.md","mol/crypto/secret/secret.ts","mol/crypto/cipher/cipher.ts","mol/crypto/auditor/auditor.ts","mol/crypto/salt/salt.ts","mol/crypto/lib/lib.meta.tree"],"mods":{},"deps_in":{"mol/crypto":{"mol/crypto/lib":-9007199254740991,"mol/crypto/secret":-9007199254740991,"mol/crypto/cipher":-9007199254740991,"mol/crypto/auditor":-9007199254740991,"mol/crypto/salt":-9007199254740991},"mol":{"mol/crypto":-9007199254740991},"":{"mol":-9007199254740991},"mol/crypto/secret":{"mol/crypto/lib":-9000},"mol/crypto/cipher":{"mol/crypto/lib":-9000},"mol/crypto/auditor":{"mol/crypto/lib":-9000},"mol/crypto/salt":{"mol/crypto/lib":-9000}},"deps_out":{"mol/crypto/lib":{"mol/crypto":-9007199254740991,"mol/crypto/secret":-9000,"mol/crypto/cipher":-9000,"mol/crypto/auditor":-9000,"mol/crypto/salt":-9000},"mol/crypto":{"mol":-9007199254740991},"mol":{"":-9007199254740991},"mol/crypto/secret":{"mol/crypto":-9007199254740991},"mol/crypto/cipher":{"mol/crypto":-9007199254740991},"mol/crypto/auditor":{"mol/crypto":-9007199254740991},"mol/crypto/salt":{"mol/crypto":-9007199254740991}},"sloc":{"LICENSE":113,"md":595,"tree":35,"js":10,"ts":286,"json":85,"lock":
|
|
1
|
+
{"files":["LICENSE","README.md","lang.lang.tree","mam.jam.js","mam.ts","package.json","sandbox.config.json","tsconfig.json","tsfmt.json","yarn.lock","mol/CNAME","mol/CODE_OF_CONDUCT.md","mol/CONTRIBUTING.md","mol/LICENSE","mol/index.html","mol/mol.meta.tree","mol/readme.md","mol/crypto/README.md","mol/crypto/secret/secret.ts","mol/crypto/cipher/cipher.ts","mol/crypto/auditor/auditor.ts","mol/crypto/salt/salt.ts","mol/crypto/lib/lib.meta.tree"],"mods":{},"deps_in":{"mol/crypto":{"mol/crypto/lib":-9007199254740991,"mol/crypto/secret":-9007199254740991,"mol/crypto/cipher":-9007199254740991,"mol/crypto/auditor":-9007199254740991,"mol/crypto/salt":-9007199254740991},"mol":{"mol/crypto":-9007199254740991},"":{"mol":-9007199254740991},"mol/crypto/secret":{"mol/crypto/lib":-9000},"mol/crypto/cipher":{"mol/crypto/lib":-9000},"mol/crypto/auditor":{"mol/crypto/lib":-9000},"mol/crypto/salt":{"mol/crypto/lib":-9000}},"deps_out":{"mol/crypto/lib":{"mol/crypto":-9007199254740991,"mol/crypto/secret":-9000,"mol/crypto/cipher":-9000,"mol/crypto/auditor":-9000,"mol/crypto/salt":-9000},"mol/crypto":{"mol":-9007199254740991},"mol":{"":-9007199254740991},"mol/crypto/secret":{"mol/crypto":-9007199254740991},"mol/crypto/cipher":{"mol/crypto":-9007199254740991},"mol/crypto/auditor":{"mol/crypto":-9007199254740991},"mol/crypto/salt":{"mol/crypto":-9007199254740991}},"sloc":{"LICENSE":113,"md":595,"tree":35,"js":10,"ts":286,"json":85,"lock":995,"CNAME":1,"html":1},"deps":{"mol/crypto/lib":{"..":-9007199254740991,"/mol/crypto/secret":-9000,"/mol/crypto/cipher":-9000,"/mol/crypto/auditor":-9000,"/mol/crypto/salt":-9000},"mol/crypto":{"..":-9007199254740991},"mol":{"..":-9007199254740991},"":{},"mol/crypto/secret":{"..":-9007199254740991,"/mol/crypto/secret":-1},"mol/crypto/cipher":{"..":-9007199254740991,"/mol/crypto/cipher/pair":-1,"/mol/crypto/cipher/public":-1,"/mol/crypto/cipher/private":-1,"/mol/crypto/cipher/ecrypted/size":-1},"mol/crypto/auditor":{"..":-9007199254740991,"/mol/crypto/auditor/pair":-1,"/mol/crypto/auditor/public":-1,"/mol/crypto/auditor/private":-1,"/mol/crypto/auditor/sign/size":-1},"mol/crypto/salt":{"..":-9007199254740991,"/mol/crypto/salt":-1}}}
|
package/node.test.js
CHANGED
|
@@ -323,6 +323,8 @@ var $node = new Proxy({ require }, {
|
|
|
323
323
|
const mod = target.require('module');
|
|
324
324
|
if (mod.builtinModules.indexOf(name) >= 0)
|
|
325
325
|
return target.require(name);
|
|
326
|
+
if (name[0] === '.')
|
|
327
|
+
return target.require(name);
|
|
326
328
|
const path = target.require('path');
|
|
327
329
|
const fs = target.require('fs');
|
|
328
330
|
let dir = path.resolve('.');
|
|
@@ -356,6 +358,161 @@ require = (req => Object.assign(function require(name) {
|
|
|
356
358
|
;
|
|
357
359
|
"use strict";
|
|
358
360
|
var $;
|
|
361
|
+
(function ($) {
|
|
362
|
+
function $mol_log3_area_lazy(event) {
|
|
363
|
+
const self = this;
|
|
364
|
+
const stack = self.$mol_log3_stack;
|
|
365
|
+
const deep = stack.length;
|
|
366
|
+
let logged = false;
|
|
367
|
+
stack.push(() => {
|
|
368
|
+
logged = true;
|
|
369
|
+
self.$mol_log3_area.call(self, event);
|
|
370
|
+
});
|
|
371
|
+
return () => {
|
|
372
|
+
if (logged)
|
|
373
|
+
self.console.groupEnd();
|
|
374
|
+
if (stack.length > deep)
|
|
375
|
+
stack.length = deep;
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
$.$mol_log3_area_lazy = $mol_log3_area_lazy;
|
|
379
|
+
$.$mol_log3_stack = [];
|
|
380
|
+
})($ || ($ = {}));
|
|
381
|
+
//mol/log3/log3.ts
|
|
382
|
+
;
|
|
383
|
+
"use strict";
|
|
384
|
+
var $;
|
|
385
|
+
(function ($) {
|
|
386
|
+
class $mol_term_color {
|
|
387
|
+
static reset = this.ansi(0, 0);
|
|
388
|
+
static bold = this.ansi(1, 22);
|
|
389
|
+
static italic = this.ansi(3, 23);
|
|
390
|
+
static underline = this.ansi(4, 24);
|
|
391
|
+
static inverse = this.ansi(7, 27);
|
|
392
|
+
static hidden = this.ansi(8, 28);
|
|
393
|
+
static strike = this.ansi(9, 29);
|
|
394
|
+
static gray = this.ansi(90, 39);
|
|
395
|
+
static red = this.ansi(91, 39);
|
|
396
|
+
static green = this.ansi(92, 39);
|
|
397
|
+
static yellow = this.ansi(93, 39);
|
|
398
|
+
static blue = this.ansi(94, 39);
|
|
399
|
+
static magenta = this.ansi(95, 39);
|
|
400
|
+
static cyan = this.ansi(96, 39);
|
|
401
|
+
static white = this.ansi(97, 39);
|
|
402
|
+
static Red = (str) => this.inverse(this.red(str));
|
|
403
|
+
static Green = (str) => this.inverse(this.green(str));
|
|
404
|
+
static Yellow = (str) => this.inverse(this.yellow(str));
|
|
405
|
+
static Blue = (str) => this.inverse(this.blue(str));
|
|
406
|
+
static Magenta = (str) => this.inverse(this.magenta(str));
|
|
407
|
+
static Cyan = (str) => this.inverse(this.cyan(str));
|
|
408
|
+
static White = (str) => this.inverse(this.white(str));
|
|
409
|
+
static ansi(open, close) {
|
|
410
|
+
if (typeof process === 'undefined')
|
|
411
|
+
return String;
|
|
412
|
+
if (!process.stdout.isTTY)
|
|
413
|
+
return String;
|
|
414
|
+
const prefix = `\x1b[${open}m`;
|
|
415
|
+
const postfix = `\x1b[${close}m`;
|
|
416
|
+
const suffix_regexp = new RegExp(postfix.replace('[', '\\['), 'g');
|
|
417
|
+
return function colorer(str) {
|
|
418
|
+
str = String(str);
|
|
419
|
+
if (str === '')
|
|
420
|
+
return str;
|
|
421
|
+
const suffix = str.replace(suffix_regexp, prefix);
|
|
422
|
+
return prefix + suffix + postfix;
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
$.$mol_term_color = $mol_term_color;
|
|
427
|
+
})($ || ($ = {}));
|
|
428
|
+
//mol/term/color/color.ts
|
|
429
|
+
;
|
|
430
|
+
"use strict";
|
|
431
|
+
var $;
|
|
432
|
+
(function ($) {
|
|
433
|
+
function $mol_log3_node_make(level, output, type, color) {
|
|
434
|
+
return function $mol_log3_logger(event) {
|
|
435
|
+
if (!event.time)
|
|
436
|
+
event = { time: new Date().toISOString(), ...event };
|
|
437
|
+
const tree = this.$mol_tree.fromJSON(event).clone({ type });
|
|
438
|
+
let str = color(tree.toString());
|
|
439
|
+
this.console[level](str);
|
|
440
|
+
const self = this;
|
|
441
|
+
return () => self.console.groupEnd();
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
$.$mol_log3_node_make = $mol_log3_node_make;
|
|
445
|
+
$.$mol_log3_come = $mol_log3_node_make('info', 'stdout', 'come', $mol_term_color.blue);
|
|
446
|
+
$.$mol_log3_done = $mol_log3_node_make('info', 'stdout', 'done', $mol_term_color.green);
|
|
447
|
+
$.$mol_log3_fail = $mol_log3_node_make('error', 'stderr', 'fail', $mol_term_color.red);
|
|
448
|
+
$.$mol_log3_warn = $mol_log3_node_make('warn', 'stderr', 'warn', $mol_term_color.yellow);
|
|
449
|
+
$.$mol_log3_rise = $mol_log3_node_make('log', 'stdout', 'rise', $mol_term_color.magenta);
|
|
450
|
+
$.$mol_log3_area = $mol_log3_node_make('log', 'stdout', 'area', $mol_term_color.cyan);
|
|
451
|
+
})($ || ($ = {}));
|
|
452
|
+
//mol/log3/log3.node.ts
|
|
453
|
+
;
|
|
454
|
+
"use strict";
|
|
455
|
+
var $;
|
|
456
|
+
(function ($_1) {
|
|
457
|
+
$mol_test_mocks.push($ => {
|
|
458
|
+
$.$mol_log3_come = () => { };
|
|
459
|
+
$.$mol_log3_done = () => { };
|
|
460
|
+
$.$mol_log3_fail = () => { };
|
|
461
|
+
$.$mol_log3_warn = () => { };
|
|
462
|
+
$.$mol_log3_rise = () => { };
|
|
463
|
+
$.$mol_log3_area = () => () => { };
|
|
464
|
+
});
|
|
465
|
+
})($ || ($ = {}));
|
|
466
|
+
//mol/log3/log3.test.ts
|
|
467
|
+
;
|
|
468
|
+
"use strict";
|
|
469
|
+
var $;
|
|
470
|
+
(function ($) {
|
|
471
|
+
function $mol_env() {
|
|
472
|
+
return {};
|
|
473
|
+
}
|
|
474
|
+
$.$mol_env = $mol_env;
|
|
475
|
+
})($ || ($ = {}));
|
|
476
|
+
//mol/env/env.ts
|
|
477
|
+
;
|
|
478
|
+
"use strict";
|
|
479
|
+
var $;
|
|
480
|
+
(function ($) {
|
|
481
|
+
$.$mol_env = function $mol_env() {
|
|
482
|
+
return this.process.env;
|
|
483
|
+
};
|
|
484
|
+
})($ || ($ = {}));
|
|
485
|
+
//mol/env/env.node.ts
|
|
486
|
+
;
|
|
487
|
+
"use strict";
|
|
488
|
+
var $;
|
|
489
|
+
(function ($) {
|
|
490
|
+
function $mol_exec(dir, command, ...args) {
|
|
491
|
+
let [app, ...args0] = command.split(' ');
|
|
492
|
+
args = [...args0, ...args];
|
|
493
|
+
this.$mol_log3_come({
|
|
494
|
+
place: '$mol_exec',
|
|
495
|
+
dir: $node.path.relative('', dir),
|
|
496
|
+
message: 'Run',
|
|
497
|
+
command: `${app} ${args.join(' ')}`,
|
|
498
|
+
});
|
|
499
|
+
var res = $node['child_process'].spawnSync(app, args, {
|
|
500
|
+
cwd: $node.path.resolve(dir),
|
|
501
|
+
shell: true,
|
|
502
|
+
env: this.$mol_env(),
|
|
503
|
+
});
|
|
504
|
+
if (res.status || res.error)
|
|
505
|
+
return $mol_fail(res.error || new Error(res.stderr.toString()));
|
|
506
|
+
if (!res.stdout)
|
|
507
|
+
res.stdout = Buffer.from([]);
|
|
508
|
+
return res;
|
|
509
|
+
}
|
|
510
|
+
$.$mol_exec = $mol_exec;
|
|
511
|
+
})($ || ($ = {}));
|
|
512
|
+
//mol/exec/exec.node.ts
|
|
513
|
+
;
|
|
514
|
+
"use strict";
|
|
515
|
+
var $;
|
|
359
516
|
(function ($) {
|
|
360
517
|
$.$mol_dom_context = new $node.jsdom.JSDOM('', { url: 'https://localhost/' }).window;
|
|
361
518
|
})($ || ($ = {}));
|
|
@@ -709,6 +866,8 @@ var $;
|
|
|
709
866
|
return Object.is(left.valueOf(), right['valueOf']());
|
|
710
867
|
if (left instanceof RegExp)
|
|
711
868
|
return left.source === right['source'] && left.flags === right['flags'];
|
|
869
|
+
if (left instanceof Error)
|
|
870
|
+
return left.stack === right['stack'];
|
|
712
871
|
let left_cache = $.$mol_compare_deep_cache.get(left);
|
|
713
872
|
if (left_cache) {
|
|
714
873
|
const right_cache = left_cache.get(right);
|
|
@@ -729,8 +888,6 @@ var $;
|
|
|
729
888
|
result = compare_set(left, right);
|
|
730
889
|
else if (left instanceof Map)
|
|
731
890
|
result = compare_map(left, right);
|
|
732
|
-
else if (left instanceof Error)
|
|
733
|
-
result = left.stack === right.stack;
|
|
734
891
|
else if (ArrayBuffer.isView(left))
|
|
735
892
|
result = compare_buffer(left, right);
|
|
736
893
|
else if (Symbol.toPrimitive in left)
|
|
@@ -944,72 +1101,6 @@ var $;
|
|
|
944
1101
|
;
|
|
945
1102
|
"use strict";
|
|
946
1103
|
var $;
|
|
947
|
-
(function ($) {
|
|
948
|
-
function $mol_log3_area_lazy(event) {
|
|
949
|
-
const self = this;
|
|
950
|
-
const stack = self.$mol_log3_stack;
|
|
951
|
-
const deep = stack.length;
|
|
952
|
-
let logged = false;
|
|
953
|
-
stack.push(() => {
|
|
954
|
-
logged = true;
|
|
955
|
-
self.$mol_log3_area.call(self, event);
|
|
956
|
-
});
|
|
957
|
-
return () => {
|
|
958
|
-
if (logged)
|
|
959
|
-
self.console.groupEnd();
|
|
960
|
-
if (stack.length > deep)
|
|
961
|
-
stack.length = deep;
|
|
962
|
-
};
|
|
963
|
-
}
|
|
964
|
-
$.$mol_log3_area_lazy = $mol_log3_area_lazy;
|
|
965
|
-
$.$mol_log3_stack = [];
|
|
966
|
-
})($ || ($ = {}));
|
|
967
|
-
//mol/log3/log3.ts
|
|
968
|
-
;
|
|
969
|
-
"use strict";
|
|
970
|
-
var $;
|
|
971
|
-
(function ($) {
|
|
972
|
-
function $mol_log3_node_make(level, output, type, color) {
|
|
973
|
-
return function $mol_log3_logger(event) {
|
|
974
|
-
if (!event.time)
|
|
975
|
-
event = { time: new Date().toISOString(), ...event };
|
|
976
|
-
const tree = this.$mol_tree.fromJSON(event).clone({ type });
|
|
977
|
-
let str = tree.toString();
|
|
978
|
-
if (process[output].isTTY) {
|
|
979
|
-
str = $node.colorette[color + 'Bright'](str);
|
|
980
|
-
}
|
|
981
|
-
;
|
|
982
|
-
this.console[level](str);
|
|
983
|
-
const self = this;
|
|
984
|
-
return () => self.console.groupEnd();
|
|
985
|
-
};
|
|
986
|
-
}
|
|
987
|
-
$.$mol_log3_node_make = $mol_log3_node_make;
|
|
988
|
-
$.$mol_log3_come = $mol_log3_node_make('info', 'stdout', 'come', 'blue');
|
|
989
|
-
$.$mol_log3_done = $mol_log3_node_make('info', 'stdout', 'done', 'green');
|
|
990
|
-
$.$mol_log3_fail = $mol_log3_node_make('error', 'stderr', 'fail', 'red');
|
|
991
|
-
$.$mol_log3_warn = $mol_log3_node_make('warn', 'stderr', 'warn', 'yellow');
|
|
992
|
-
$.$mol_log3_rise = $mol_log3_node_make('log', 'stdout', 'rise', 'magenta');
|
|
993
|
-
$.$mol_log3_area = $mol_log3_node_make('log', 'stdout', 'area', 'cyan');
|
|
994
|
-
})($ || ($ = {}));
|
|
995
|
-
//mol/log3/log3.node.ts
|
|
996
|
-
;
|
|
997
|
-
"use strict";
|
|
998
|
-
var $;
|
|
999
|
-
(function ($_1) {
|
|
1000
|
-
$mol_test_mocks.push($ => {
|
|
1001
|
-
$.$mol_log3_come = () => { };
|
|
1002
|
-
$.$mol_log3_done = () => { };
|
|
1003
|
-
$.$mol_log3_fail = () => { };
|
|
1004
|
-
$.$mol_log3_warn = () => { };
|
|
1005
|
-
$.$mol_log3_rise = () => { };
|
|
1006
|
-
$.$mol_log3_area = () => () => { };
|
|
1007
|
-
});
|
|
1008
|
-
})($ || ($ = {}));
|
|
1009
|
-
//mol/log3/log3.test.ts
|
|
1010
|
-
;
|
|
1011
|
-
"use strict";
|
|
1012
|
-
var $;
|
|
1013
1104
|
(function ($) {
|
|
1014
1105
|
$.$mol_ambient_ref = Symbol('$mol_ambient_ref');
|
|
1015
1106
|
function $mol_ambient(overrides) {
|
|
@@ -1616,52 +1707,6 @@ var $;
|
|
|
1616
1707
|
;
|
|
1617
1708
|
"use strict";
|
|
1618
1709
|
var $;
|
|
1619
|
-
(function ($) {
|
|
1620
|
-
function $mol_env() {
|
|
1621
|
-
return {};
|
|
1622
|
-
}
|
|
1623
|
-
$.$mol_env = $mol_env;
|
|
1624
|
-
})($ || ($ = {}));
|
|
1625
|
-
//mol/env/env.ts
|
|
1626
|
-
;
|
|
1627
|
-
"use strict";
|
|
1628
|
-
var $;
|
|
1629
|
-
(function ($) {
|
|
1630
|
-
$.$mol_env = function $mol_env() {
|
|
1631
|
-
return this.process.env;
|
|
1632
|
-
};
|
|
1633
|
-
})($ || ($ = {}));
|
|
1634
|
-
//mol/env/env.node.ts
|
|
1635
|
-
;
|
|
1636
|
-
"use strict";
|
|
1637
|
-
var $;
|
|
1638
|
-
(function ($) {
|
|
1639
|
-
function $mol_exec(dir, command, ...args) {
|
|
1640
|
-
let [app, ...args0] = command.split(' ');
|
|
1641
|
-
args = [...args0, ...args];
|
|
1642
|
-
this.$mol_log3_come({
|
|
1643
|
-
place: '$mol_exec',
|
|
1644
|
-
dir: $node.path.relative('', dir),
|
|
1645
|
-
message: 'Run',
|
|
1646
|
-
command: `${app} ${args.join(' ')}`,
|
|
1647
|
-
});
|
|
1648
|
-
var res = $node['child_process'].spawnSync(app, args, {
|
|
1649
|
-
cwd: $node.path.resolve(dir),
|
|
1650
|
-
shell: true,
|
|
1651
|
-
env: this.$mol_env(),
|
|
1652
|
-
});
|
|
1653
|
-
if (res.status || res.error)
|
|
1654
|
-
return $mol_fail(res.error || new Error(res.stderr.toString()));
|
|
1655
|
-
if (!res.stdout)
|
|
1656
|
-
res.stdout = Buffer.from([]);
|
|
1657
|
-
return res;
|
|
1658
|
-
}
|
|
1659
|
-
$.$mol_exec = $mol_exec;
|
|
1660
|
-
})($ || ($ = {}));
|
|
1661
|
-
//mol/exec/exec.node.ts
|
|
1662
|
-
;
|
|
1663
|
-
"use strict";
|
|
1664
|
-
var $;
|
|
1665
1710
|
(function ($) {
|
|
1666
1711
|
$mol_test({
|
|
1667
1712
|
async 'sizes'() {
|