e22m4u 3 дней назад
Родитель
Сommit
5dd85728fa
4 измененных файлов с 63 добавлено и 61 удалено
  1. 57 58
      dist/cjs/index.cjs
  2. 1 0
      eslint.config.js
  3. 1 1
      mocha.setup.js
  4. 4 2
      package.json

+ 57 - 58
dist/cjs/index.cjs

@@ -385,65 +385,8 @@ function generateRandomHex(length = 4) {
 }
 __name(generateRandomHex, "generateRandomHex");
 
-// node_modules/@e22m4u/js-debug/src/debuggable.js
-var _Debuggable = class _Debuggable {
-  /**
-   * Debug.
-   *
-   * @type {Function}
-   */
-  debug;
-  /**
-   * Ctor Debug.
-   *
-   * @type {Function}
-   */
-  ctorDebug;
-  /**
-   * Возвращает функцию-отладчик с сегментом пространства имен
-   * указанного в параметре метода.
-   *
-   * @param {Function} method
-   * @returns {Function}
-   */
-  getDebuggerFor(method) {
-    const name = method.name || "anonymous";
-    return this.debug.withHash().withNs(name);
-  }
-  /**
-   * Constructor.
-   *
-   * @param {DebuggableOptions|undefined} options
-   */
-  constructor(options = void 0) {
-    const className = toCamelCase(this.constructor.name);
-    options = typeof options === "object" && options || {};
-    const namespace = options.namespace && String(options.namespace) || void 0;
-    if (namespace) {
-      this.debug = createDebugger(namespace, className);
-    } else {
-      this.debug = createDebugger(className);
-    }
-    const noEnvironmentNamespace = Boolean(options.noEnvironmentNamespace);
-    if (noEnvironmentNamespace) this.debug = this.debug.withoutEnvNs();
-    this.ctorDebug = this.debug.withNs("constructor").withHash();
-    const noInstantiationMessage = Boolean(options.noInstantiationMessage);
-    if (!noInstantiationMessage)
-      this.ctorDebug(_Debuggable.INSTANTIATION_MESSAGE);
-  }
-};
-__name(_Debuggable, "Debuggable");
-/**
- * Instantiation message;
- *
- * @type {string}
- */
-__publicField(_Debuggable, "INSTANTIATION_MESSAGE", "Instantiated.");
-var Debuggable = _Debuggable;
-
 // node_modules/@e22m4u/js-debug/src/create-debugger.js
 var import_js_format2 = require("@e22m4u/js-format");
-var import_js_format3 = require("@e22m4u/js-format");
 
 // node_modules/@e22m4u/js-debug/src/create-colorized-dump.js
 var import_util = require("util");
@@ -649,7 +592,7 @@ function createDebugger(namespaceOrOptions = void 0, ...namespaceSegments) {
   function debugFn(messageOrData, ...args) {
     if (!isDebuggerEnabled()) return;
     const prefix = getPrefix();
-    const multiString = (0, import_js_format3.format)(messageOrData, ...args);
+    const multiString = (0, import_js_format2.format)(messageOrData, ...args);
     const rows = multiString.split("\n");
     rows.forEach((message) => {
       prefix ? console.log(`${prefix} ${message}`) : console.log(message);
@@ -718,6 +661,62 @@ function createDebugger(namespaceOrOptions = void 0, ...namespaceSegments) {
 }
 __name(createDebugger, "createDebugger");
 
+// node_modules/@e22m4u/js-debug/src/debuggable.js
+var _Debuggable = class _Debuggable {
+  /**
+   * Debug.
+   *
+   * @type {*}
+   */
+  debug;
+  /**
+   * Ctor Debug.
+   *
+   * @type {Function}
+   */
+  ctorDebug;
+  /**
+   * Возвращает функцию-отладчик с сегментом пространства имен
+   * указанного в параметре метода.
+   *
+   * @param {Function} method
+   * @returns {Function}
+   */
+  getDebuggerFor(method) {
+    const name = method.name || "anonymous";
+    return this.debug.withHash().withNs(name);
+  }
+  /**
+   * Constructor.
+   *
+   * @param {DebuggableOptions} [options]
+   */
+  constructor(options = void 0) {
+    const className = toCamelCase(this.constructor.name);
+    options = typeof options === "object" && options || {};
+    const namespace = options.namespace && String(options.namespace) || void 0;
+    if (namespace) {
+      this.debug = createDebugger(namespace, className);
+    } else {
+      this.debug = createDebugger(className);
+    }
+    const noEnvironmentNamespace = Boolean(options.noEnvironmentNamespace);
+    if (noEnvironmentNamespace) this.debug = this.debug.withoutEnvNs();
+    this.ctorDebug = this.debug.withNs("constructor").withHash();
+    const noInstantiationMessage = Boolean(options.noInstantiationMessage);
+    if (!noInstantiationMessage)
+      this.ctorDebug(_Debuggable.INSTANTIATION_MESSAGE);
+  }
+};
+__name(_Debuggable, "Debuggable");
+/**
+ * Instantiation message.
+ *
+ * @type {string}
+ */
+__publicField(_Debuggable, "INSTANTIATION_MESSAGE", "Instantiated.");
+var Debuggable = _Debuggable;
+
 // node_modules/@e22m4u/js-service/src/debuggable-service.js
 var _DebuggableService = class _DebuggableService extends Debuggable {
   /**

+ 1 - 0
eslint.config.js

@@ -28,6 +28,7 @@ export default [{
     ...eslintChaiExpectPlugin.configs['recommended-flat'].rules,
     ...eslintJsdocPlugin.configs['flat/recommended-error'].rules,
     'no-duplicate-imports': 'error',
+    'import/export': 0,
     'jsdoc/reject-any-type': 0,
     'jsdoc/reject-function-type': 0,
     'jsdoc/require-param-description': 0,

+ 1 - 1
mocha.setup.js

@@ -6,6 +6,6 @@ import chaiAsPromised from 'chai-as-promised';
 process.env['NODE_ENV'] = 'test';
 const dirname = url.fileURLToPath(new URL('.', import.meta.url));
 const envFile = `${dirname}/${process.env['NODE_ENV']}.env`;
-dotenv.config({path: envFile});
+dotenv.config({path: envFile, quiet: true});
 
 chai.use(chaiAsPromised);

+ 4 - 2
package.json

@@ -38,7 +38,7 @@
     "prepare": "husky"
   },
   "dependencies": {
-    "@e22m4u/js-format": "~0.3.0",
+    "@e22m4u/js-format": "~0.3.1",
     "mongodb": "6.20.0"
   },
   "peerDependencies": {
@@ -48,6 +48,8 @@
     "@commitlint/cli": "~20.1.0",
     "@commitlint/config-conventional": "~20.0.0",
     "@eslint/js": "~9.39.1",
+    "@types/chai": "~5.2.3",
+    "@types/mocha": "~10.0.10",
     "c8": "~10.1.3",
     "chai": "~6.2.1",
     "chai-as-promised": "~8.0.2",
@@ -62,7 +64,7 @@
     "globals": "~16.5.0",
     "husky": "~9.1.7",
     "mocha": "~11.7.5",
-    "prettier": "~3.7.3",
+    "prettier": "~3.7.4",
     "rimraf": "~6.1.2"
   }
 }