@e-mc/module 0.9.29 → 0.9.30

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.9.29/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.9.30/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { LogStatus } from "./squared";
@@ -394,11 +394,11 @@ type ForegroundColor = typeof IForegroundColor | `#${string}`;
394
394
 
395
395
  ## References
396
396
 
397
- - https://www.unpkg.com/@e-mc/types@0.9.29/lib/core.d.ts
398
- - https://www.unpkg.com/@e-mc/types@0.9.29/lib/logger.d.ts
399
- - https://www.unpkg.com/@e-mc/types@0.9.29/lib/module.d.ts
400
- - https://www.unpkg.com/@e-mc/types@0.9.29/lib/node.d.ts
401
- - https://www.unpkg.com/@e-mc/types@0.9.29/lib/settings.d.ts
397
+ - https://www.unpkg.com/@e-mc/types@0.9.30/lib/core.d.ts
398
+ - https://www.unpkg.com/@e-mc/types@0.9.30/lib/logger.d.ts
399
+ - https://www.unpkg.com/@e-mc/types@0.9.30/lib/module.d.ts
400
+ - https://www.unpkg.com/@e-mc/types@0.9.30/lib/node.d.ts
401
+ - https://www.unpkg.com/@e-mc/types@0.9.30/lib/settings.d.ts
402
402
 
403
403
  * https://www.npmjs.com/package/@types/node
404
404
 
package/index.js CHANGED
@@ -156,7 +156,15 @@ let TEMP_DIR = path.join(PROCESS_CWD, "tmp");
156
156
  let PNPM_VER;
157
157
  let YARN_VER;
158
158
  function parseYaml(pathname) {
159
- return yaml.load(fs.readFileSync(pathname, 'utf-8'));
159
+ let value;
160
+ try {
161
+ return yaml.load(value = fs.readFileSync(pathname, 'utf-8'));
162
+ }
163
+ catch {
164
+ if (value) {
165
+ return JSON.parse(value);
166
+ }
167
+ }
160
168
  }
161
169
  function setPnpmVer() {
162
170
  if (PNPM_VER === undefined) {
@@ -725,7 +733,7 @@ class Module extends EventEmitter {
725
733
  this[_f] = new AbortController();
726
734
  this[_g] = null;
727
735
  }
728
- static get VERSION() { return "0.9.29"; }
736
+ static get VERSION() { return "0.9.30"; }
729
737
  static get LOG_TYPE() { return types_1.LOG_TYPE; }
730
738
  static get STATUS_TYPE() { return types_1.STATUS_TYPE; }
731
739
  static get MAX_TIMEOUT() { return 2147483647; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/module",
3
- "version": "0.9.29",
3
+ "version": "0.9.30",
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.9.29",
23
+ "@e-mc/types": "0.9.30",
24
24
  "chalk": "4.1.2",
25
25
  "file-type": "16.5.4",
26
26
  "js-yaml": "^4.1.1",