@e-mc/document 0.5.6 → 0.5.7

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/asset.js +0 -1
  2. package/index.js +4 -4
  3. package/package.json +4 -4
package/asset.js CHANGED
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
2
  exports.setInitialValue = exports.isEqual = void 0;
4
3
  function isEqual(item, other) {
5
4
  return !!(item.id && item.id === other.id || item.uri === other.uri && item.pathname === other.pathname && item.filename === other.filename && item.pathname && item.filename);
package/index.js CHANGED
@@ -622,14 +622,14 @@ class Document extends core_1.Client {
622
622
  }
623
623
  let result;
624
624
  if ((value = value.trim()).startsWith('npm:')) {
625
+ if (!core_1.Client.enabled("node.require.npm")) {
626
+ return null;
627
+ }
625
628
  const pkgName = value.substring(4);
626
629
  if (persist) {
627
630
  result = CACHE_REQUIRE[pkgName];
628
631
  }
629
632
  if (!result) {
630
- if (!core_1.Client.enabled("node.require.npm")) {
631
- return null;
632
- }
633
633
  try {
634
634
  if (!persist) {
635
635
  delete require.cache[pkgName];
@@ -651,7 +651,7 @@ class Document extends core_1.Client {
651
651
  }
652
652
  }
653
653
  try {
654
- const source = result || this.readFile(value, { ownPermissionOnly: true, absolutePath: this.hasEval('absolute'), requireExt: true, encoding, cache }) || value;
654
+ const source = (result || this.readFile(value, { ownPermissionOnly: true, absolutePath: this.hasEval('absolute'), requireExt: true, encoding: (0, types_1.getEncoding)(encoding), cache })) || value;
655
655
  if (typeof source !== 'string') {
656
656
  result = source;
657
657
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/document",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "Document constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -20,9 +20,9 @@
20
20
  "license": "MIT",
21
21
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
22
  "dependencies": {
23
- "@e-mc/core": "0.5.6",
24
- "@e-mc/db": "0.5.6",
25
- "@e-mc/types": "0.5.6",
23
+ "@e-mc/core": "0.5.7",
24
+ "@e-mc/db": "0.5.7",
25
+ "@e-mc/types": "0.5.7",
26
26
  "chalk": "4.1.2",
27
27
  "htmlparser2": "^9.0.0",
28
28
  "js-yaml": "^4.1.0",