@naturalcycles/js-lib 14.245.0 → 14.245.1

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.
@@ -5,7 +5,8 @@ exports.commonLoggerMinLevel = commonLoggerMinLevel;
5
5
  exports.commonLoggerPipe = commonLoggerPipe;
6
6
  exports.commonLoggerPrefix = commonLoggerPrefix;
7
7
  exports.commonLoggerCreate = commonLoggerCreate;
8
- const index_1 = require("../index");
8
+ // copy-pasted to avoid weird circular dependency
9
+ const _noop = (..._args) => undefined;
9
10
  exports.commonLogLevelNumber = {
10
11
  log: 10,
11
12
  warn: 20,
@@ -17,9 +18,9 @@ exports.commonLogLevelNumber = {
17
18
  * @experimental
18
19
  */
19
20
  exports.commonLoggerNoop = {
20
- log: index_1._noop,
21
- warn: index_1._noop,
22
- error: index_1._noop,
21
+ log: _noop,
22
+ warn: _noop,
23
+ error: _noop,
23
24
  };
24
25
  /**
25
26
  * Creates a "child" logger that is "limited" to the specified CommonLogLevel.
@@ -28,11 +29,11 @@ function commonLoggerMinLevel(logger, minLevel, mutate = false) {
28
29
  const level = exports.commonLogLevelNumber[minLevel];
29
30
  if (mutate) {
30
31
  if (level > exports.commonLogLevelNumber['log']) {
31
- logger.log = index_1._noop;
32
+ logger.log = _noop;
32
33
  if (level > exports.commonLogLevelNumber['warn']) {
33
- logger.warn = index_1._noop;
34
+ logger.warn = _noop;
34
35
  if (level > exports.commonLogLevelNumber['error']) {
35
- logger.error = index_1._noop;
36
+ logger.error = _noop;
36
37
  }
37
38
  }
38
39
  }
@@ -47,8 +48,8 @@ function commonLoggerMinLevel(logger, minLevel, mutate = false) {
47
48
  return exports.commonLoggerNoop;
48
49
  }
49
50
  return {
50
- log: index_1._noop, // otherwise it is "log everything" logger (same logger as input)
51
- warn: level <= exports.commonLogLevelNumber['warn'] ? logger.warn.bind(logger) : index_1._noop,
51
+ log: _noop, // otherwise it is "log everything" logger (same logger as input)
52
+ warn: level <= exports.commonLogLevelNumber['warn'] ? logger.warn.bind(logger) : _noop,
52
53
  error: logger.error.bind(logger), // otherwise it's "log nothing" logger (same as noopLogger)
53
54
  };
54
55
  }
@@ -1,4 +1,5 @@
1
- import { _noop } from '../index';
1
+ // copy-pasted to avoid weird circular dependency
2
+ const _noop = (..._args) => undefined;
2
3
  export const commonLogLevelNumber = {
3
4
  log: 10,
4
5
  warn: 20,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/js-lib",
3
- "version": "14.245.0",
3
+ "version": "14.245.1",
4
4
  "scripts": {
5
5
  "prepare": "husky",
6
6
  "build-prod": "build-prod-esm-cjs",
@@ -1,4 +1,5 @@
1
- import { _noop } from '../index'
1
+ // copy-pasted to avoid weird circular dependency
2
+ const _noop = (..._args: any[]): undefined => undefined
2
3
 
3
4
  /**
4
5
  * These levels follow console.* naming,