@e-mc/module 0.10.21 → 0.10.22

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.10.21/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.10.22/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { LogStatus } from "./squared";
@@ -407,11 +407,11 @@ interface LoggerModule {
407
407
 
408
408
  ## References
409
409
 
410
- - https://www.unpkg.com/@e-mc/types@0.10.21/lib/core.d.ts
411
- - https://www.unpkg.com/@e-mc/types@0.10.21/lib/logger.d.ts
412
- - https://www.unpkg.com/@e-mc/types@0.10.21/lib/module.d.ts
413
- - https://www.unpkg.com/@e-mc/types@0.10.21/lib/node.d.ts
414
- - https://www.unpkg.com/@e-mc/types@0.10.21/lib/settings.d.ts
410
+ - https://www.unpkg.com/@e-mc/types@0.10.22/lib/core.d.ts
411
+ - https://www.unpkg.com/@e-mc/types@0.10.22/lib/logger.d.ts
412
+ - https://www.unpkg.com/@e-mc/types@0.10.22/lib/module.d.ts
413
+ - https://www.unpkg.com/@e-mc/types@0.10.22/lib/node.d.ts
414
+ - https://www.unpkg.com/@e-mc/types@0.10.22/lib/settings.d.ts
415
415
 
416
416
  * https://www.npmjs.com/package/@types/node
417
417
 
package/index.js CHANGED
@@ -172,7 +172,15 @@ let PNPM_VER;
172
172
  let YARN_VER;
173
173
  let FILETYPE_ESM = null;
174
174
  function parseYaml(pathname) {
175
- return yaml.load(fs.readFileSync(pathname, 'utf-8'));
175
+ let value;
176
+ try {
177
+ return yaml.load(value = fs.readFileSync(pathname, 'utf-8'));
178
+ }
179
+ catch {
180
+ if (value) {
181
+ return JSON.parse(value);
182
+ }
183
+ }
176
184
  }
177
185
  function setPnpmVer() {
178
186
  if (PNPM_VER === undefined) {
@@ -940,7 +948,7 @@ class Module extends EventEmitter {
940
948
  this[_g] = null;
941
949
  }
942
950
  static get VERSION() {
943
- return "0.10.21";
951
+ return "0.10.22";
944
952
  }
945
953
  static get LOG_TYPE() {
946
954
  return types_1.LOG_TYPE;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/module",
3
- "version": "0.10.21",
3
+ "version": "0.10.22",
4
4
  "description": "Module base class for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -20,7 +20,7 @@
20
20
  "license": "MIT",
21
21
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
22
  "dependencies": {
23
- "@e-mc/types": "0.10.21",
23
+ "@e-mc/types": "0.10.22",
24
24
  "chalk": "4.1.2",
25
25
  "file-type": "^18.7.0",
26
26
  "js-yaml": "^4.1.1",