@vuepress/shared 2.0.0-beta.24 → 2.0.0-beta.32
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/esm/types/page.d.ts +6 -5
- package/lib/esm/types/site.d.ts +1 -1
- package/lib/esm/utils/index.d.ts +1 -0
- package/lib/esm/utils/index.js +1 -0
- package/lib/esm/utils/isLinkExternal.js +3 -2
- package/lib/esm/utils/isLinkFtp.d.ts +4 -0
- package/lib/esm/utils/isLinkFtp.js +4 -0
- package/lib/types/page.d.ts +6 -5
- package/lib/types/site.d.ts +1 -1
- package/lib/utils/dedupeHead.js +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/isLinkExternal.js +3 -2
- package/lib/utils/isLinkFtp.d.ts +4 -0
- package/lib/utils/isLinkFtp.js +8 -0
- package/package.json +3 -3
package/lib/esm/types/page.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { HeadConfig } from './head';
|
|
|
2
2
|
/**
|
|
3
3
|
* Vuepress page data
|
|
4
4
|
*/
|
|
5
|
-
export declare type PageData<
|
|
5
|
+
export declare type PageData<ExtraPageData extends Record<any, any> = Record<never, never>> = ExtraPageData & {
|
|
6
6
|
/**
|
|
7
7
|
* Identifier of the page
|
|
8
8
|
*
|
|
@@ -50,14 +50,15 @@ export declare type PageData<ExtendedPageData extends Record<any, any> = Record<
|
|
|
50
50
|
* so we cannot guarantee the type safety
|
|
51
51
|
*/
|
|
52
52
|
export declare type PageFrontmatter<T extends Record<any, any> = Record<string, unknown>> = Partial<T> & {
|
|
53
|
+
date?: string | Date;
|
|
54
|
+
description?: string;
|
|
55
|
+
head?: HeadConfig[];
|
|
56
|
+
lang?: string;
|
|
53
57
|
layout?: string;
|
|
54
58
|
permalink?: string;
|
|
55
59
|
permalinkPattern?: string;
|
|
56
|
-
|
|
57
|
-
lang?: string;
|
|
60
|
+
routeMeta?: Record<string, unknown>;
|
|
58
61
|
title?: string;
|
|
59
|
-
description?: string;
|
|
60
|
-
head?: HeadConfig[];
|
|
61
62
|
};
|
|
62
63
|
/**
|
|
63
64
|
* Vuepress page header
|
package/lib/esm/types/site.d.ts
CHANGED
package/lib/esm/utils/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './formatDateString';
|
|
|
6
6
|
export * from './htmlEscape';
|
|
7
7
|
export * from './htmlUnescape';
|
|
8
8
|
export * from './isLinkExternal';
|
|
9
|
+
export * from './isLinkFtp';
|
|
9
10
|
export * from './isLinkHttp';
|
|
10
11
|
export * from './isLinkMailto';
|
|
11
12
|
export * from './isLinkTel';
|
package/lib/esm/utils/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export * from './formatDateString';
|
|
|
6
6
|
export * from './htmlEscape';
|
|
7
7
|
export * from './htmlUnescape';
|
|
8
8
|
export * from './isLinkExternal';
|
|
9
|
+
export * from './isLinkFtp';
|
|
9
10
|
export * from './isLinkHttp';
|
|
10
11
|
export * from './isLinkMailto';
|
|
11
12
|
export * from './isLinkTel';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { isLinkFtp } from './isLinkFtp';
|
|
1
2
|
import { isLinkHttp } from './isLinkHttp';
|
|
2
3
|
/**
|
|
3
4
|
* Determine a link is external or not
|
|
4
5
|
*/
|
|
5
6
|
export const isLinkExternal = (link, base = '/') => {
|
|
6
|
-
// http link
|
|
7
|
-
if (isLinkHttp(link)) {
|
|
7
|
+
// http link or ftp link
|
|
8
|
+
if (isLinkHttp(link) || isLinkFtp(link)) {
|
|
8
9
|
return true;
|
|
9
10
|
}
|
|
10
11
|
// absolute link that does not start with `base`
|
package/lib/types/page.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { HeadConfig } from './head';
|
|
|
2
2
|
/**
|
|
3
3
|
* Vuepress page data
|
|
4
4
|
*/
|
|
5
|
-
export declare type PageData<
|
|
5
|
+
export declare type PageData<ExtraPageData extends Record<any, any> = Record<never, never>> = ExtraPageData & {
|
|
6
6
|
/**
|
|
7
7
|
* Identifier of the page
|
|
8
8
|
*
|
|
@@ -50,14 +50,15 @@ export declare type PageData<ExtendedPageData extends Record<any, any> = Record<
|
|
|
50
50
|
* so we cannot guarantee the type safety
|
|
51
51
|
*/
|
|
52
52
|
export declare type PageFrontmatter<T extends Record<any, any> = Record<string, unknown>> = Partial<T> & {
|
|
53
|
+
date?: string | Date;
|
|
54
|
+
description?: string;
|
|
55
|
+
head?: HeadConfig[];
|
|
56
|
+
lang?: string;
|
|
53
57
|
layout?: string;
|
|
54
58
|
permalink?: string;
|
|
55
59
|
permalinkPattern?: string;
|
|
56
|
-
|
|
57
|
-
lang?: string;
|
|
60
|
+
routeMeta?: Record<string, unknown>;
|
|
58
61
|
title?: string;
|
|
59
|
-
description?: string;
|
|
60
|
-
head?: HeadConfig[];
|
|
61
62
|
};
|
|
62
63
|
/**
|
|
63
64
|
* Vuepress page header
|
package/lib/types/site.d.ts
CHANGED
package/lib/utils/dedupeHead.js
CHANGED
|
@@ -11,7 +11,7 @@ const dedupeHead = (head) => {
|
|
|
11
11
|
const identifierSet = new Set();
|
|
12
12
|
const result = [];
|
|
13
13
|
head.forEach((item) => {
|
|
14
|
-
const identifier = resolveHeadIdentifier_1.resolveHeadIdentifier(item);
|
|
14
|
+
const identifier = (0, resolveHeadIdentifier_1.resolveHeadIdentifier)(item);
|
|
15
15
|
if (!identifierSet.has(identifier)) {
|
|
16
16
|
identifierSet.add(identifier);
|
|
17
17
|
result.push(item);
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './formatDateString';
|
|
|
6
6
|
export * from './htmlEscape';
|
|
7
7
|
export * from './htmlUnescape';
|
|
8
8
|
export * from './isLinkExternal';
|
|
9
|
+
export * from './isLinkFtp';
|
|
9
10
|
export * from './isLinkHttp';
|
|
10
11
|
export * from './isLinkMailto';
|
|
11
12
|
export * from './isLinkTel';
|
package/lib/utils/index.js
CHANGED
|
@@ -23,6 +23,7 @@ __exportStar(require("./formatDateString"), exports);
|
|
|
23
23
|
__exportStar(require("./htmlEscape"), exports);
|
|
24
24
|
__exportStar(require("./htmlUnescape"), exports);
|
|
25
25
|
__exportStar(require("./isLinkExternal"), exports);
|
|
26
|
+
__exportStar(require("./isLinkFtp"), exports);
|
|
26
27
|
__exportStar(require("./isLinkHttp"), exports);
|
|
27
28
|
__exportStar(require("./isLinkMailto"), exports);
|
|
28
29
|
__exportStar(require("./isLinkTel"), exports);
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isLinkExternal = void 0;
|
|
4
|
+
const isLinkFtp_1 = require("./isLinkFtp");
|
|
4
5
|
const isLinkHttp_1 = require("./isLinkHttp");
|
|
5
6
|
/**
|
|
6
7
|
* Determine a link is external or not
|
|
7
8
|
*/
|
|
8
9
|
const isLinkExternal = (link, base = '/') => {
|
|
9
|
-
// http link
|
|
10
|
-
if (isLinkHttp_1.isLinkHttp(link)) {
|
|
10
|
+
// http link or ftp link
|
|
11
|
+
if ((0, isLinkHttp_1.isLinkHttp)(link) || (0, isLinkFtp_1.isLinkFtp)(link)) {
|
|
11
12
|
return true;
|
|
12
13
|
}
|
|
13
14
|
// absolute link that does not start with `base`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/shared",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.32",
|
|
4
4
|
"description": "Utils that shared between VuePress node and client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vuepress",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"clean": "rimraf lib *.tsbuildinfo"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@vue/shared": "^3.2.
|
|
31
|
+
"@vue/shared": "^3.2.24"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "8ffa71313607fe78f3956e3ccb886fcae0ddf5e9"
|
|
37
37
|
}
|