@vpmedia/simplify 1.8.0 → 1.9.0

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @vpmedia/simplify
2
2
 
3
- [![npm version](https://badge.fury.io/js/@vpmedia%2Fsimplify.svg?v=1.8.0)](https://badge.fury.io/js/@vpmedia%2Fsimplify)
3
+ [![npm version](https://badge.fury.io/js/@vpmedia%2Fsimplify.svg?v=1.9.0)](https://badge.fury.io/js/@vpmedia%2Fsimplify)
4
4
  [![Node.js CI](https://github.com/vpmedia/simplify/actions/workflows/ci.yml/badge.svg)](https://github.com/vpmedia/simplify/actions/workflows/ci.yml)
5
5
 
6
6
  @vpmedia/simplify TBD
package/eslint.config.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import js from '@eslint/js';
2
- // import importPlugin from 'eslint-plugin-import';
3
2
  import jsdocPlugin from 'eslint-plugin-jsdoc';
4
3
  import unicornPlugin from 'eslint-plugin-unicorn';
5
4
  import globals from 'globals';
@@ -37,7 +36,6 @@ export default [
37
36
  },
38
37
  files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
39
38
  plugins: {
40
- // import: importPlugin,
41
39
  jsdoc: jsdocPlugin,
42
40
  unicorn: unicornPlugin,
43
41
  },
@@ -52,7 +50,6 @@ export default [
52
50
  rules: {
53
51
  ...js.configs.recommended.rules,
54
52
  ...jsdocPlugin.configs['flat/recommended'].rules,
55
- // ...importPlugin.configs.recommended.rules,
56
53
  ...unicornPlugin.configs['flat/recommended'].rules,
57
54
  'unicorn/filename-case': 'off',
58
55
  'unicorn/no-null': 'off',
@@ -62,7 +59,6 @@ export default [
62
59
  'no-unused-vars': 'off',
63
60
  'prefer-arrow-callback': 'error',
64
61
  'prefer-template': 'error',
65
- // 'import/extensions': ['warn', 'always'],
66
62
  'jsdoc/require-jsdoc': [
67
63
  'error',
68
64
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vpmedia/simplify",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "@vpmedia/simplify",
5
5
  "author": "Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)",
6
6
  "license": "MIT",
@@ -19,19 +19,19 @@
19
19
  "types": "./types/index.d.ts",
20
20
  "type": "module",
21
21
  "devDependencies": {
22
- "@babel/preset-env": "^7.25.7",
23
- "@eslint/js": "^9.10.0",
22
+ "@babel/preset-env": "^7.25.8",
23
+ "@eslint/js": "^9.12.0",
24
24
  "@jest/globals": "^29.7.0",
25
25
  "@types/jest": "^29.5.13",
26
26
  "eslint": "^9.12.0",
27
- "eslint-plugin-jsdoc": "^50.3.1",
27
+ "eslint-plugin-jsdoc": "^50.3.2",
28
28
  "eslint-plugin-unicorn": "^56.0.0",
29
- "globals": "^15.10.0",
29
+ "globals": "^15.11.0",
30
30
  "jest": "^29.7.0",
31
31
  "jest-environment-jsdom": "^29.7.0",
32
32
  "lefthook": "^1.7.18",
33
33
  "prettier": "^3.3.3",
34
- "typescript": "^5.6.2"
34
+ "typescript": "^5.6.3"
35
35
  },
36
36
  "scripts": {
37
37
  "test": "NODE_OPTIONS=--experimental-vm-modules jest --passWithNoTests",
@@ -9,9 +9,13 @@ export const LEVEL_SILENT = 0;
9
9
 
10
10
  export class Logger {
11
11
  /**
12
- * @type {(error) => {}}
12
+ * @type {(error: Error) => {}}
13
13
  */
14
14
  static exceptionHandler = null;
15
+ /**
16
+ * @type {(level: string, message: string, extraData: object) => {}}
17
+ */
18
+ static suppressedLogHandler = null;
15
19
 
16
20
  /**
17
21
  * Creates a new Logger instance.
@@ -33,6 +37,9 @@ export class Logger {
33
37
  */
34
38
  debug(message, extraData = null) {
35
39
  if (this.level < LEVEL_DEBUG) {
40
+ if (Logger.suppressedLogHandler) {
41
+ Logger.suppressedLogHandler('debug', message, extraData);
42
+ }
36
43
  return;
37
44
  }
38
45
  const logMessage = `${Date.now()} [${this.name}] ${message}`;
@@ -50,6 +57,9 @@ export class Logger {
50
57
  */
51
58
  info(message, extraData = null) {
52
59
  if (this.level < LEVEL_INFO) {
60
+ if (Logger.suppressedLogHandler) {
61
+ Logger.suppressedLogHandler('info', message, extraData);
62
+ }
53
63
  return;
54
64
  }
55
65
  const logMessage = `${Date.now()} [${this.name}] ${message}`;
@@ -67,6 +77,9 @@ export class Logger {
67
77
  */
68
78
  warn(message, extraData = null) {
69
79
  if (this.level < LEVEL_WARN) {
80
+ if (Logger.suppressedLogHandler) {
81
+ Logger.suppressedLogHandler('warning', message, extraData);
82
+ }
70
83
  return;
71
84
  }
72
85
  const logMessage = `${Date.now()} [${this.name}] ${message}`;
@@ -84,6 +97,9 @@ export class Logger {
84
97
  */
85
98
  error(message, extraData = null) {
86
99
  if (this.level < LEVEL_ERROR) {
100
+ if (Logger.suppressedLogHandler) {
101
+ Logger.suppressedLogHandler('error', message, extraData);
102
+ }
87
103
  return;
88
104
  }
89
105
  const logMessage = `${Date.now()} [${this.name}] ${message}`;