marked-base-url 1.1.9 → 1.1.11
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/lib/index.cjs +2 -3
- package/lib/index.umd.js +2 -3
- package/package.json +14 -17
- package/src/index.js +2 -3
package/lib/index.cjs
CHANGED
|
@@ -4,8 +4,7 @@ function baseUrl(base) {
|
|
|
4
4
|
// extension code here
|
|
5
5
|
|
|
6
6
|
base = base.trim().replace(/\/+$/, '/'); // if multiple '/' at the end, just keep one
|
|
7
|
-
const
|
|
8
|
-
const isBaseAbsolute = reIsAbsolute.test(base);
|
|
7
|
+
const isBaseAbsolute = URL.canParse(base);
|
|
9
8
|
const dummyUrl = 'http://__dummy__';
|
|
10
9
|
const dummyBaseUrl = new URL(base, dummyUrl);
|
|
11
10
|
const dummyUrlLength = dummyUrl.length + (base.startsWith('/') ? 0 : 1);
|
|
@@ -16,7 +15,7 @@ function baseUrl(base) {
|
|
|
16
15
|
return;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
if (
|
|
18
|
+
if (URL.canParse(token.href)) {
|
|
20
19
|
// the URL is absolute, do not touch it
|
|
21
20
|
return;
|
|
22
21
|
}
|
package/lib/index.umd.js
CHANGED
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
// extension code here
|
|
9
9
|
|
|
10
10
|
base = base.trim().replace(/\/+$/, '/'); // if multiple '/' at the end, just keep one
|
|
11
|
-
const
|
|
12
|
-
const isBaseAbsolute = reIsAbsolute.test(base);
|
|
11
|
+
const isBaseAbsolute = URL.canParse(base);
|
|
13
12
|
const dummyUrl = 'http://__dummy__';
|
|
14
13
|
const dummyBaseUrl = new URL(base, dummyUrl);
|
|
15
14
|
const dummyUrlLength = dummyUrl.length + (base.startsWith('/') ? 0 : 1);
|
|
@@ -20,7 +19,7 @@
|
|
|
20
19
|
return;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
if (
|
|
22
|
+
if (URL.canParse(token.href)) {
|
|
24
23
|
// the URL is absolute, do not touch it
|
|
25
24
|
return;
|
|
26
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marked-base-url",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11",
|
|
4
4
|
"description": "marked base url",
|
|
5
5
|
"main": "./lib/index.cjs",
|
|
6
6
|
"module": "./src/index.js",
|
|
@@ -19,13 +19,14 @@
|
|
|
19
19
|
],
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
22
|
+
"types": "./src/index.d.ts",
|
|
22
23
|
"import": "./src/index.js",
|
|
23
24
|
"require": "./lib/index.cjs"
|
|
24
25
|
}
|
|
25
26
|
},
|
|
26
27
|
"scripts": {
|
|
27
|
-
"test": "
|
|
28
|
-
"test:cover": "
|
|
28
|
+
"test": "node --test",
|
|
29
|
+
"test:cover": "node --experimental-test-coverage --test",
|
|
29
30
|
"test:types": "tsd -t src/index.d.ts -f types_test/index.test-d.ts",
|
|
30
31
|
"lint": "eslint",
|
|
31
32
|
"format": "eslint --fix",
|
|
@@ -45,22 +46,18 @@
|
|
|
45
46
|
"marked": ">= 4 < 19"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@babel/core": "^7.29.0",
|
|
49
|
-
"@babel/preset-env": "^7.29.2",
|
|
50
49
|
"@markedjs/eslint-config": "^1.0.14",
|
|
51
|
-
"@semantic-release/changelog": "^
|
|
50
|
+
"@semantic-release/changelog": "^7.0.0",
|
|
52
51
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
53
|
-
"@semantic-release/git": "^
|
|
54
|
-
"@semantic-release/github": "^12.0.
|
|
55
|
-
"@semantic-release/npm": "^13.
|
|
56
|
-
"@semantic-release/release-notes-generator": "^14.1.
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"rollup": "^4.60.1",
|
|
63
|
-
"semantic-release": "^25.0.3",
|
|
52
|
+
"@semantic-release/git": "^11.0.1",
|
|
53
|
+
"@semantic-release/github": "^12.0.10",
|
|
54
|
+
"@semantic-release/npm": "^13.2.0",
|
|
55
|
+
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
56
|
+
"eslint": "^10.14.0",
|
|
57
|
+
"globals": "^17.14.0",
|
|
58
|
+
"marked": "^18.1.3",
|
|
59
|
+
"rollup": "^4.67.5",
|
|
60
|
+
"semantic-release": "^25.0.9",
|
|
64
61
|
"tsd": "^0.33.0"
|
|
65
62
|
},
|
|
66
63
|
"tsd": {
|
package/src/index.js
CHANGED
|
@@ -2,8 +2,7 @@ export function baseUrl(base) {
|
|
|
2
2
|
// extension code here
|
|
3
3
|
|
|
4
4
|
base = base.trim().replace(/\/+$/, '/'); // if multiple '/' at the end, just keep one
|
|
5
|
-
const
|
|
6
|
-
const isBaseAbsolute = reIsAbsolute.test(base);
|
|
5
|
+
const isBaseAbsolute = URL.canParse(base);
|
|
7
6
|
const dummyUrl = 'http://__dummy__';
|
|
8
7
|
const dummyBaseUrl = new URL(base, dummyUrl);
|
|
9
8
|
const dummyUrlLength = dummyUrl.length + (base.startsWith('/') ? 0 : 1);
|
|
@@ -14,7 +13,7 @@ export function baseUrl(base) {
|
|
|
14
13
|
return;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
if (
|
|
16
|
+
if (URL.canParse(token.href)) {
|
|
18
17
|
// the URL is absolute, do not touch it
|
|
19
18
|
return;
|
|
20
19
|
}
|