@e-mc/module 0.11.17 → 0.11.19

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 +7 -7
  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.11.17/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.11.19/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { LogStatus } from "./squared";
@@ -414,14 +414,14 @@ interface LoggerModule {
414
414
 
415
415
  ## References
416
416
 
417
- - https://www.unpkg.com/@e-mc/types@0.11.17/lib/core.d.ts
418
- - https://www.unpkg.com/@e-mc/types@0.11.17/lib/logger.d.ts
419
- - https://www.unpkg.com/@e-mc/types@0.11.17/lib/module.d.ts
420
- - https://www.unpkg.com/@e-mc/types@0.11.17/lib/node.d.ts
421
- - https://www.unpkg.com/@e-mc/types@0.11.17/lib/settings.d.ts
417
+ - https://www.unpkg.com/@e-mc/types@0.11.19/lib/core.d.ts
418
+ - https://www.unpkg.com/@e-mc/types@0.11.19/lib/logger.d.ts
419
+ - https://www.unpkg.com/@e-mc/types@0.11.19/lib/module.d.ts
420
+ - https://www.unpkg.com/@e-mc/types@0.11.19/lib/node.d.ts
421
+ - https://www.unpkg.com/@e-mc/types@0.11.19/lib/settings.d.ts
422
422
 
423
423
  * https://www.npmjs.com/package/@types/node
424
424
 
425
425
  ## LICENSE
426
426
 
427
- BSD 3-Clause
427
+ MIT
package/index.js CHANGED
@@ -175,7 +175,15 @@ let PNPM_VER;
175
175
  let YARN_VER;
176
176
  let FILETYPE_ESM = null;
177
177
  function parseYaml(pathname) {
178
- return yaml.load(fs.readFileSync(pathname, 'utf-8'));
178
+ let value;
179
+ try {
180
+ return yaml.load(value = fs.readFileSync(pathname, 'utf-8'));
181
+ }
182
+ catch {
183
+ if (value) {
184
+ return JSON.parse(value);
185
+ }
186
+ }
179
187
  }
180
188
  function setPnpmVer() {
181
189
  if (PNPM_VER === undefined) {
@@ -964,7 +972,7 @@ class Module extends EventEmitter {
964
972
  this[_g] = null;
965
973
  }
966
974
  static get VERSION() {
967
- return "0.11.17";
975
+ return "0.11.19";
968
976
  }
969
977
  static get LOG_TYPE() {
970
978
  return types_1.LOG_TYPE;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/module",
3
- "version": "0.11.17",
3
+ "version": "0.11.19",
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.11.17",
23
+ "@e-mc/types": "0.11.19",
24
24
  "chalk": "4.1.2",
25
25
  "file-type": "^18.7.0",
26
26
  "js-yaml": "^4.1.1",