@vuepress/shared 2.0.0-beta.23 → 2.0.0-beta.28

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.
@@ -2,7 +2,7 @@ import type { HeadConfig } from './head';
2
2
  /**
3
3
  * Vuepress page data
4
4
  */
5
- export declare type PageData<ExtendedPageData extends Record<any, any> = Record<never, never>> = ExtendedPageData & {
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
- date?: string | Date;
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
@@ -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';
@@ -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`
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Determine a link is ftp link or not
3
+ */
4
+ export declare const isLinkFtp: (link: string) => boolean;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Determine a link is ftp link or not
3
+ */
4
+ export const isLinkFtp = (link) => link.startsWith('ftp://');
@@ -2,7 +2,7 @@ import type { HeadConfig } from './head';
2
2
  /**
3
3
  * Vuepress page data
4
4
  */
5
- export declare type PageData<ExtendedPageData extends Record<any, any> = Record<never, never>> = ExtendedPageData & {
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
- date?: string | Date;
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
@@ -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);
@@ -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';
@@ -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`
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Determine a link is ftp link or not
3
+ */
4
+ export declare const isLinkFtp: (link: string) => boolean;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isLinkFtp = void 0;
4
+ /**
5
+ * Determine a link is ftp link or not
6
+ */
7
+ const isLinkFtp = (link) => link.startsWith('ftp://');
8
+ exports.isLinkFtp = isLinkFtp;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/shared",
3
- "version": "2.0.0-beta.23",
3
+ "version": "2.0.0-beta.28",
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.1.5"
31
+ "@vue/shared": "^3.2.24"
32
32
  },
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "a8fde04c51473d9b7aef1a49550f9c8f3483b645"
36
+ "gitHead": "71c34816a79263c7dcba3ff0c103e264abdbf0d2"
37
37
  }