@e-mc/module 0.12.17 → 0.12.18

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.
Files changed (3) hide show
  1. package/README.md +6 -6
  2. package/index.js +10 -2
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- * [View Source](https://www.unpkg.com/@e-mc/types@0.12.17/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.12.18/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { LogStatus } from "./squared";
@@ -422,11 +422,11 @@ interface LoggerModule {
422
422
 
423
423
  ## References
424
424
 
425
- - https://www.unpkg.com/@e-mc/types@0.12.17/lib/core.d.ts
426
- - https://www.unpkg.com/@e-mc/types@0.12.17/lib/logger.d.ts
427
- - https://www.unpkg.com/@e-mc/types@0.12.17/lib/module.d.ts
428
- - https://www.unpkg.com/@e-mc/types@0.12.17/lib/node.d.ts
429
- - https://www.unpkg.com/@e-mc/types@0.12.17/lib/settings.d.ts
425
+ - https://www.unpkg.com/@e-mc/types@0.12.18/lib/core.d.ts
426
+ - https://www.unpkg.com/@e-mc/types@0.12.18/lib/logger.d.ts
427
+ - https://www.unpkg.com/@e-mc/types@0.12.18/lib/module.d.ts
428
+ - https://www.unpkg.com/@e-mc/types@0.12.18/lib/node.d.ts
429
+ - https://www.unpkg.com/@e-mc/types@0.12.18/lib/settings.d.ts
430
430
 
431
431
  * https://www.npmjs.com/package/@types/node
432
432
  * https://www.npmjs.com/package/file-type
package/index.js CHANGED
@@ -151,7 +151,15 @@ let PNPM_VER;
151
151
  let YARN_VER;
152
152
  let FILETYPE_ESM = null;
153
153
  function parseYaml(pathname) {
154
- return yaml.load(fs.readFileSync(pathname, 'utf8'));
154
+ let value;
155
+ try {
156
+ return yaml.load(value = fs.readFileSync(pathname, 'utf8'));
157
+ }
158
+ catch {
159
+ if (value) {
160
+ return JSON.parse(value);
161
+ }
162
+ }
155
163
  }
156
164
  function setPnpmVer() {
157
165
  if (PNPM_VER === undefined) {
@@ -851,7 +859,7 @@ class Module extends EventEmitter {
851
859
  static LOG_STYLE_NOTICE = Object.freeze({ titleBgColor: 'bgGrey', titleColor: 'white' });
852
860
  static LOG_STYLE_REVERSE = Object.freeze({ titleBgColor: 'bgWhite', titleColor: 'black', messageBgColor: 'bgGrey' });
853
861
  static get VERSION() {
854
- return "0.12.17";
862
+ return "0.12.18";
855
863
  }
856
864
  static get LOG_TYPE() {
857
865
  return types_1.LOG_TYPE;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/module",
3
- "version": "0.12.17",
3
+ "version": "0.12.18",
4
4
  "description": "Module base class for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -19,7 +19,7 @@
19
19
  "license": "MIT",
20
20
  "homepage": "https://github.com/anpham6/e-mc#readme",
21
21
  "dependencies": {
22
- "@e-mc/types": "0.12.17",
22
+ "@e-mc/types": "0.12.18",
23
23
  "chalk": "4.1.2",
24
24
  "file-type": "^18.7.0",
25
25
  "js-yaml": "^4.1.1",