@weborigami/async-tree 0.2.9 → 0.2.10
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/package.json +3 -3
- package/src/drivers/SiteTree.js +3 -3
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weborigami/async-tree",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "Asynchronous tree drivers based on standard JavaScript classes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./main.js",
|
|
7
7
|
"browser": "./browser.js",
|
|
8
8
|
"types": "./index.ts",
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@types/node": "22.13.
|
|
10
|
+
"@types/node": "22.13.13",
|
|
11
11
|
"typescript": "5.8.2"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@weborigami/types": "0.2.
|
|
14
|
+
"@weborigami/types": "0.2.10"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"test": "node --test --test-reporter=spec",
|
package/src/drivers/SiteTree.js
CHANGED
|
@@ -13,10 +13,10 @@ export default class SiteTree {
|
|
|
13
13
|
/**
|
|
14
14
|
* @param {string} href
|
|
15
15
|
*/
|
|
16
|
-
constructor(href =
|
|
17
|
-
if (href?.startsWith(".") &&
|
|
16
|
+
constructor(href = globalThis?.location.href) {
|
|
17
|
+
if (href?.startsWith(".") && globalThis?.location !== undefined) {
|
|
18
18
|
// URL represents a relative path; concatenate with current location.
|
|
19
|
-
href = new URL(href,
|
|
19
|
+
href = new URL(href, globalThis.location.href).href;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
// Add trailing slash if not present; URL should represent a directory.
|