@e-mc/document 0.5.1 → 0.5.2
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/index.js +5 -2
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -416,7 +416,7 @@ class Document extends core_1.Client {
|
|
|
416
416
|
if ((0, types_1.isString)(handler) && handler !== "@e-mc/db" /* PACKAGE_NAME.DB */) {
|
|
417
417
|
try {
|
|
418
418
|
const Handler = require(handler);
|
|
419
|
-
if (isFunction(Handler) && Handler.prototype instanceof
|
|
419
|
+
if (isFunction(Handler) && Handler.prototype instanceof core_1.ClientDb) {
|
|
420
420
|
instance = new Handler(db, database);
|
|
421
421
|
}
|
|
422
422
|
else {
|
|
@@ -688,7 +688,10 @@ class Document extends core_1.Client {
|
|
|
688
688
|
}
|
|
689
689
|
findSourceRoot(uri, imports = this.imports) {
|
|
690
690
|
if (imports) {
|
|
691
|
-
const normalizeDir = (value) =>
|
|
691
|
+
const normalizeDir = (value) => {
|
|
692
|
+
const sep = value.includes('\\') && !value.includes('/') ? '\\' : '/';
|
|
693
|
+
return value + (value[value.length - 1] !== sep ? sep : '');
|
|
694
|
+
};
|
|
692
695
|
for (const url in imports) {
|
|
693
696
|
if (uri === url || normalizeDir(uri) === normalizeDir(url)) {
|
|
694
697
|
return imports[url];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/document",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
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": "BSD 3-Clause",
|
|
21
21
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/core": "0.5.
|
|
24
|
-
"@e-mc/db": "0.5.
|
|
25
|
-
"@e-mc/types": "0.5.
|
|
23
|
+
"@e-mc/core": "0.5.2",
|
|
24
|
+
"@e-mc/db": "0.5.2",
|
|
25
|
+
"@e-mc/types": "0.5.2",
|
|
26
26
|
"chalk": "4.1.2",
|
|
27
27
|
"htmlparser2": "^8.0.2",
|
|
28
28
|
"js-yaml": "^4.1.0",
|