@e22m4u/js-repository-mongodb-adapter 0.8.1 → 0.8.2
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/dist/cjs/index.cjs +57 -58
- package/eslint.config.js +1 -0
- package/mocha.setup.js +1 -1
- package/package.json +6 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -385,65 +385,8 @@ function generateRandomHex(length = 4) {
|
|
|
385
385
|
}
|
|
386
386
|
__name(generateRandomHex, "generateRandomHex");
|
|
387
387
|
|
|
388
|
-
// node_modules/@e22m4u/js-debug/src/debuggable.js
|
|
389
|
-
var _Debuggable = class _Debuggable {
|
|
390
|
-
/**
|
|
391
|
-
* Debug.
|
|
392
|
-
*
|
|
393
|
-
* @type {Function}
|
|
394
|
-
*/
|
|
395
|
-
debug;
|
|
396
|
-
/**
|
|
397
|
-
* Ctor Debug.
|
|
398
|
-
*
|
|
399
|
-
* @type {Function}
|
|
400
|
-
*/
|
|
401
|
-
ctorDebug;
|
|
402
|
-
/**
|
|
403
|
-
* Возвращает функцию-отладчик с сегментом пространства имен
|
|
404
|
-
* указанного в параметре метода.
|
|
405
|
-
*
|
|
406
|
-
* @param {Function} method
|
|
407
|
-
* @returns {Function}
|
|
408
|
-
*/
|
|
409
|
-
getDebuggerFor(method) {
|
|
410
|
-
const name = method.name || "anonymous";
|
|
411
|
-
return this.debug.withHash().withNs(name);
|
|
412
|
-
}
|
|
413
|
-
/**
|
|
414
|
-
* Constructor.
|
|
415
|
-
*
|
|
416
|
-
* @param {DebuggableOptions|undefined} options
|
|
417
|
-
*/
|
|
418
|
-
constructor(options = void 0) {
|
|
419
|
-
const className = toCamelCase(this.constructor.name);
|
|
420
|
-
options = typeof options === "object" && options || {};
|
|
421
|
-
const namespace = options.namespace && String(options.namespace) || void 0;
|
|
422
|
-
if (namespace) {
|
|
423
|
-
this.debug = createDebugger(namespace, className);
|
|
424
|
-
} else {
|
|
425
|
-
this.debug = createDebugger(className);
|
|
426
|
-
}
|
|
427
|
-
const noEnvironmentNamespace = Boolean(options.noEnvironmentNamespace);
|
|
428
|
-
if (noEnvironmentNamespace) this.debug = this.debug.withoutEnvNs();
|
|
429
|
-
this.ctorDebug = this.debug.withNs("constructor").withHash();
|
|
430
|
-
const noInstantiationMessage = Boolean(options.noInstantiationMessage);
|
|
431
|
-
if (!noInstantiationMessage)
|
|
432
|
-
this.ctorDebug(_Debuggable.INSTANTIATION_MESSAGE);
|
|
433
|
-
}
|
|
434
|
-
};
|
|
435
|
-
__name(_Debuggable, "Debuggable");
|
|
436
|
-
/**
|
|
437
|
-
* Instantiation message;
|
|
438
|
-
*
|
|
439
|
-
* @type {string}
|
|
440
|
-
*/
|
|
441
|
-
__publicField(_Debuggable, "INSTANTIATION_MESSAGE", "Instantiated.");
|
|
442
|
-
var Debuggable = _Debuggable;
|
|
443
|
-
|
|
444
388
|
// node_modules/@e22m4u/js-debug/src/create-debugger.js
|
|
445
389
|
var import_js_format2 = require("@e22m4u/js-format");
|
|
446
|
-
var import_js_format3 = require("@e22m4u/js-format");
|
|
447
390
|
|
|
448
391
|
// node_modules/@e22m4u/js-debug/src/create-colorized-dump.js
|
|
449
392
|
var import_util = require("util");
|
|
@@ -649,7 +592,7 @@ function createDebugger(namespaceOrOptions = void 0, ...namespaceSegments) {
|
|
|
649
592
|
function debugFn(messageOrData, ...args) {
|
|
650
593
|
if (!isDebuggerEnabled()) return;
|
|
651
594
|
const prefix = getPrefix();
|
|
652
|
-
const multiString = (0,
|
|
595
|
+
const multiString = (0, import_js_format2.format)(messageOrData, ...args);
|
|
653
596
|
const rows = multiString.split("\n");
|
|
654
597
|
rows.forEach((message) => {
|
|
655
598
|
prefix ? console.log(`${prefix} ${message}`) : console.log(message);
|
|
@@ -718,6 +661,62 @@ function createDebugger(namespaceOrOptions = void 0, ...namespaceSegments) {
|
|
|
718
661
|
}
|
|
719
662
|
__name(createDebugger, "createDebugger");
|
|
720
663
|
|
|
664
|
+
// node_modules/@e22m4u/js-debug/src/debuggable.js
|
|
665
|
+
var _Debuggable = class _Debuggable {
|
|
666
|
+
/**
|
|
667
|
+
* Debug.
|
|
668
|
+
*
|
|
669
|
+
* @type {*}
|
|
670
|
+
*/
|
|
671
|
+
debug;
|
|
672
|
+
/**
|
|
673
|
+
* Ctor Debug.
|
|
674
|
+
*
|
|
675
|
+
* @type {Function}
|
|
676
|
+
*/
|
|
677
|
+
ctorDebug;
|
|
678
|
+
/**
|
|
679
|
+
* Возвращает функцию-отладчик с сегментом пространства имен
|
|
680
|
+
* указанного в параметре метода.
|
|
681
|
+
*
|
|
682
|
+
* @param {Function} method
|
|
683
|
+
* @returns {Function}
|
|
684
|
+
*/
|
|
685
|
+
getDebuggerFor(method) {
|
|
686
|
+
const name = method.name || "anonymous";
|
|
687
|
+
return this.debug.withHash().withNs(name);
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Constructor.
|
|
691
|
+
*
|
|
692
|
+
* @param {DebuggableOptions} [options]
|
|
693
|
+
*/
|
|
694
|
+
constructor(options = void 0) {
|
|
695
|
+
const className = toCamelCase(this.constructor.name);
|
|
696
|
+
options = typeof options === "object" && options || {};
|
|
697
|
+
const namespace = options.namespace && String(options.namespace) || void 0;
|
|
698
|
+
if (namespace) {
|
|
699
|
+
this.debug = createDebugger(namespace, className);
|
|
700
|
+
} else {
|
|
701
|
+
this.debug = createDebugger(className);
|
|
702
|
+
}
|
|
703
|
+
const noEnvironmentNamespace = Boolean(options.noEnvironmentNamespace);
|
|
704
|
+
if (noEnvironmentNamespace) this.debug = this.debug.withoutEnvNs();
|
|
705
|
+
this.ctorDebug = this.debug.withNs("constructor").withHash();
|
|
706
|
+
const noInstantiationMessage = Boolean(options.noInstantiationMessage);
|
|
707
|
+
if (!noInstantiationMessage)
|
|
708
|
+
this.ctorDebug(_Debuggable.INSTANTIATION_MESSAGE);
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
__name(_Debuggable, "Debuggable");
|
|
712
|
+
/**
|
|
713
|
+
* Instantiation message.
|
|
714
|
+
*
|
|
715
|
+
* @type {string}
|
|
716
|
+
*/
|
|
717
|
+
__publicField(_Debuggable, "INSTANTIATION_MESSAGE", "Instantiated.");
|
|
718
|
+
var Debuggable = _Debuggable;
|
|
719
|
+
|
|
721
720
|
// node_modules/@e22m4u/js-service/src/debuggable-service.js
|
|
722
721
|
var _DebuggableService = class _DebuggableService extends Debuggable {
|
|
723
722
|
/**
|
package/eslint.config.js
CHANGED
|
@@ -28,6 +28,7 @@ export default [{
|
|
|
28
28
|
...eslintChaiExpectPlugin.configs['recommended-flat'].rules,
|
|
29
29
|
...eslintJsdocPlugin.configs['flat/recommended-error'].rules,
|
|
30
30
|
'no-duplicate-imports': 'error',
|
|
31
|
+
'import/export': 0,
|
|
31
32
|
'jsdoc/reject-any-type': 0,
|
|
32
33
|
'jsdoc/reject-function-type': 0,
|
|
33
34
|
'jsdoc/require-param-description': 0,
|
package/mocha.setup.js
CHANGED
|
@@ -6,6 +6,6 @@ import chaiAsPromised from 'chai-as-promised';
|
|
|
6
6
|
process.env['NODE_ENV'] = 'test';
|
|
7
7
|
const dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
8
8
|
const envFile = `${dirname}/${process.env['NODE_ENV']}.env`;
|
|
9
|
-
dotenv.config({path: envFile});
|
|
9
|
+
dotenv.config({path: envFile, quiet: true});
|
|
10
10
|
|
|
11
11
|
chai.use(chaiAsPromised);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e22m4u/js-repository-mongodb-adapter",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "MongoDB адаптер для @e22m4u/js-repository",
|
|
5
5
|
"author": "Mikhail Evstropov <e22m4u@yandex.ru>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"format": "prettier --write \"./src/**/*.js\"",
|
|
35
35
|
"test": "npm run lint && c8 --reporter=text-summary mocha --bail",
|
|
36
36
|
"test:coverage": "npm run lint && c8 --reporter=text mocha --bail",
|
|
37
|
-
"build:cjs": "rimraf ./dist/cjs && node
|
|
37
|
+
"build:cjs": "rimraf ./dist/cjs && node build-cjs.js",
|
|
38
38
|
"prepare": "husky"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@e22m4u/js-format": "~0.3.
|
|
41
|
+
"@e22m4u/js-format": "~0.3.1",
|
|
42
42
|
"mongodb": "6.20.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
@@ -48,6 +48,8 @@
|
|
|
48
48
|
"@commitlint/cli": "~20.1.0",
|
|
49
49
|
"@commitlint/config-conventional": "~20.0.0",
|
|
50
50
|
"@eslint/js": "~9.39.1",
|
|
51
|
+
"@types/chai": "~5.2.3",
|
|
52
|
+
"@types/mocha": "~10.0.10",
|
|
51
53
|
"c8": "~10.1.3",
|
|
52
54
|
"chai": "~6.2.1",
|
|
53
55
|
"chai-as-promised": "~8.0.2",
|
|
@@ -62,7 +64,7 @@
|
|
|
62
64
|
"globals": "~16.5.0",
|
|
63
65
|
"husky": "~9.1.7",
|
|
64
66
|
"mocha": "~11.7.5",
|
|
65
|
-
"prettier": "~3.7.
|
|
67
|
+
"prettier": "~3.7.4",
|
|
66
68
|
"rimraf": "~6.1.2"
|
|
67
69
|
}
|
|
68
70
|
}
|