mol_compare_deep 0.0.1468 → 0.0.1470
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.test.js +27 -31
- package/node.test.js.map +1 -1
- package/package.json +1 -1
package/node.test.js
CHANGED
|
@@ -683,34 +683,41 @@ var $;
|
|
|
683
683
|
|
|
684
684
|
;
|
|
685
685
|
"use strict";
|
|
686
|
-
var
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
return target.require(name);
|
|
693
|
-
if (name[0] === '.')
|
|
694
|
-
return target.require(name);
|
|
686
|
+
var $;
|
|
687
|
+
(function ($) {
|
|
688
|
+
const path = require('path');
|
|
689
|
+
const mod = require('module');
|
|
690
|
+
const localRequire = mod.createRequire(path.join(process.cwd(), 'package.json'));
|
|
691
|
+
function $node_autoinstall(name) {
|
|
695
692
|
try {
|
|
696
|
-
|
|
693
|
+
localRequire.resolve(name);
|
|
697
694
|
}
|
|
698
695
|
catch {
|
|
699
|
-
|
|
696
|
+
this.$mol_run.spawn({ command: ['npm', 'install', '--omit=dev', name], dir: '.' });
|
|
700
697
|
try {
|
|
701
|
-
|
|
698
|
+
this.$mol_run.spawn({ command: ['npm', 'install', '--omit=dev', '@types/' + name], dir: '.' });
|
|
702
699
|
}
|
|
703
700
|
catch (e) {
|
|
704
|
-
if (
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
}
|
|
708
|
-
const mam_node_modules = target.require('node:path').join(process.cwd(), 'node_modules');
|
|
709
|
-
if (!process.env.NODE_PATH?.includes(mam_node_modules)) {
|
|
710
|
-
process.env.NODE_PATH = `${mam_node_modules}${process.env.NODE_PATH ? `:${process.env.NODE_PATH}` : ''}`;
|
|
711
|
-
target.require('node:module').Module._initPaths();
|
|
701
|
+
if (this.$mol_promise_like(e))
|
|
702
|
+
this.$mol_fail_hidden(e);
|
|
703
|
+
this.$mol_fail_log(e);
|
|
712
704
|
}
|
|
713
705
|
}
|
|
706
|
+
}
|
|
707
|
+
$.$node_autoinstall = $node_autoinstall;
|
|
708
|
+
})($ || ($ = {}));
|
|
709
|
+
|
|
710
|
+
;
|
|
711
|
+
"use strict";
|
|
712
|
+
var $node = new Proxy({ require }, {
|
|
713
|
+
get(target, name, wrapper) {
|
|
714
|
+
if (target[name])
|
|
715
|
+
return target[name];
|
|
716
|
+
if ($.$node_internal_check(name))
|
|
717
|
+
return target.require(name);
|
|
718
|
+
if (name[0] === '.')
|
|
719
|
+
return target.require(name);
|
|
720
|
+
$.$node_autoinstall(name);
|
|
714
721
|
return target.require(name);
|
|
715
722
|
},
|
|
716
723
|
set(target, name, value) {
|
|
@@ -718,7 +725,6 @@ var $node = new Proxy({ require }, {
|
|
|
718
725
|
return true;
|
|
719
726
|
},
|
|
720
727
|
});
|
|
721
|
-
const cache = new Map();
|
|
722
728
|
require = (req => Object.assign(function require(name) {
|
|
723
729
|
return $node[name];
|
|
724
730
|
}, req))(require);
|
|
@@ -3281,16 +3287,6 @@ var $;
|
|
|
3281
3287
|
});
|
|
3282
3288
|
})($ || ($ = {}));
|
|
3283
3289
|
|
|
3284
|
-
;
|
|
3285
|
-
"use strict";
|
|
3286
|
-
var $;
|
|
3287
|
-
(function ($) {
|
|
3288
|
-
function $mol_exec(dir, command, ...args) {
|
|
3289
|
-
return this.$mol_run.spawn({ command: [command, ...args], dir });
|
|
3290
|
-
}
|
|
3291
|
-
$.$mol_exec = $mol_exec;
|
|
3292
|
-
})($ || ($ = {}));
|
|
3293
|
-
|
|
3294
3290
|
;
|
|
3295
3291
|
"use strict";
|
|
3296
3292
|
var $;
|