@e-mc/document 0.6.3 → 0.6.5

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.
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2023 Ninja Scroll
1
+ Copyright 2024 An Pham
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @e-mc/document
2
2
 
3
- PEP 402 - Forever Kagerō
3
+ PEP 402 - Forever Any Mayo
4
4
 
5
5
  ## LICENSE
6
6
 
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
@@ -608,14 +608,14 @@ class Document extends core_1.Client {
608
608
  }
609
609
  let result;
610
610
  if ((value = value.trim()).startsWith('npm:')) {
611
+ if (!core_1.Client.enabled("node.require.npm")) {
612
+ return null;
613
+ }
611
614
  const pkgName = value.substring(4);
612
615
  if (persist) {
613
616
  result = CACHE_REQUIRE[pkgName];
614
617
  }
615
618
  if (!result) {
616
- if (!core_1.Client.enabled("node.require.npm")) {
617
- return null;
618
- }
619
619
  try {
620
620
  if (!persist) {
621
621
  delete require.cache[pkgName];
@@ -637,7 +637,7 @@ class Document extends core_1.Client {
637
637
  }
638
638
  }
639
639
  try {
640
- const source = result || this.readFile(value, { ownPermissionOnly: true, absolutePath: this.hasEval('absolute'), requireExt: true, encoding, cache }) || value;
640
+ const source = (result || this.readFile(value, { ownPermissionOnly: true, absolutePath: this.hasEval('absolute'), requireExt: true, encoding: (0, types_1.getEncoding)(encoding), cache })) || value;
641
641
  if (typeof source !== 'string') {
642
642
  result = source;
643
643
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/document",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
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.6.3",
24
- "@e-mc/db": "0.6.3",
25
- "@e-mc/types": "0.6.3",
23
+ "@e-mc/core": "0.6.5",
24
+ "@e-mc/db": "0.6.5",
25
+ "@e-mc/types": "0.6.5",
26
26
  "chalk": "4.1.2",
27
27
  "htmlparser2": "^9.0.0",
28
28
  "js-yaml": "^4.1.0",
package/parse/index.js CHANGED
@@ -11,7 +11,7 @@ var IGNORE_FLAG;
11
11
  IGNORE_FLAG[IGNORE_FLAG["NONE"] = 0] = "NONE";
12
12
  IGNORE_FLAG[IGNORE_FLAG["INTERIOR"] = 1] = "INTERIOR";
13
13
  IGNORE_FLAG[IGNORE_FLAG["LOCATOR"] = 2] = "LOCATOR";
14
- })(IGNORE_FLAG = exports.IGNORE_FLAG || (exports.IGNORE_FLAG = {}));
14
+ })(IGNORE_FLAG || (exports.IGNORE_FLAG = IGNORE_FLAG = {}));
15
15
  const Parser = htmlparser2.Parser;
16
16
  const DomHandler = domhandler.DomHandler;
17
17
  const CACHE_TAGNAME = {};
@@ -313,6 +313,6 @@ class SourceMap {
313
313
  return this[kMap];
314
314
  }
315
315
  }
316
+ exports.SourceMap = SourceMap;
316
317
  _d = kMap;
317
318
  SourceMap.RE_SOURCE_MAPPING_URL = /(?:\r\n|\n)*(?:(\/\/)|(\/\*))\s*[#@][ ]+sourceMappingURL=(data:[^,]+,)?(\S+)\s*(\*\/)?\r?\n?/g;
318
- exports.SourceMap = SourceMap;