@tryghost/mg-json 0.11.7 → 0.11.9
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {slugify} from '@tryghost/string';
|
|
2
2
|
import emailValidator from 'node-email-verifier';
|
|
3
3
|
|
|
4
|
-
export default async (json
|
|
4
|
+
export default async (json) => {
|
|
5
5
|
if (!json.posts) {
|
|
6
6
|
return json;
|
|
7
7
|
}
|
|
@@ -12,7 +12,7 @@ export default async (json, ctx = null) => {
|
|
|
12
12
|
// String length data from https://github.com/TryGhost/Ghost/blob/main/ghost/core/core/server/data/schema/schema.js
|
|
13
13
|
let properties = {
|
|
14
14
|
title: 255,
|
|
15
|
-
slug:
|
|
15
|
+
slug: 185,
|
|
16
16
|
custom_excerpt: 300,
|
|
17
17
|
og_title: 300,
|
|
18
18
|
og_description: 500,
|
|
@@ -28,9 +28,8 @@ export default async (json, ctx = null) => {
|
|
|
28
28
|
if (input[propKey] && input[propKey].length > propValue) {
|
|
29
29
|
let truncated = input[propKey].substring(0, propValue).trim();
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
31
|
+
// eslint-disable-next-line no-console
|
|
32
|
+
console.warn(`${propKey} for slug "${item.data.slug}" is too long.\nOriginal: "${input[propKey]}"\nTruncated to: "${truncated}"`);
|
|
34
33
|
|
|
35
34
|
input[propKey] = truncated;
|
|
36
35
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/mg-json",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.9",
|
|
4
4
|
"repository": "https://github.com/TryGhost/migrate/tree/main/packages/mg-json",
|
|
5
5
|
"author": "Ghost Foundation",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"eslint": "8.57.0",
|
|
24
|
-
"jest": "
|
|
25
|
-
"jest-extended": "
|
|
24
|
+
"jest": "30.0.5",
|
|
25
|
+
"jest-extended": "6.0.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@tryghost/string": "0.2.
|
|
28
|
+
"@tryghost/string": "0.2.17",
|
|
29
29
|
"bson-objectid": "2.0.4",
|
|
30
30
|
"html-entities": "2.6.0",
|
|
31
31
|
"lodash": "4.17.21",
|
|
32
32
|
"node-email-verifier": "2.0.0"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "89e6e38587face966cdfadfbbc74aef95c594c7c"
|
|
35
35
|
}
|