@tryghost/mg-json 0.20.0 → 0.22.0
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.
|
@@ -19,7 +19,8 @@ const {startCase, kebabCase} = stringUtils;
|
|
|
19
19
|
*/
|
|
20
20
|
const fakeName = 'Example User';
|
|
21
21
|
const fakeEmailDomain = `example.com`;
|
|
22
|
-
|
|
22
|
+
// The local part (before the @) must be 50 chars or fewer to pass Ghost's email validation
|
|
23
|
+
const fakeEmail = (nameSlug, domain) => `${nameSlug.slice(0, 50).replace(/-+$/, '')}@${domain}`;
|
|
23
24
|
|
|
24
25
|
const hydrateUser = (input, options) => {
|
|
25
26
|
// Handle the case where we have a slug but no name
|
|
@@ -68,7 +68,8 @@ export default async (json) => {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
if (!isEmailValid) {
|
|
71
|
-
|
|
71
|
+
// The local part (before the @) must be 50 chars or fewer to pass Ghost's email validation
|
|
72
|
+
item.data.email = `${slugify(item?.data?.slug || item?.data?.name || 'author').slice(0, 50).replace(/-+$/, '')}@example.com`;
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
json.users[index] = item;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/mg-json",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/TryGhost/migrate.git",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"eslint": "8.57.1"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@tryghost/string": "0.3.
|
|
24
|
+
"@tryghost/string": "0.3.5",
|
|
25
25
|
"bson-objectid": "2.0.4",
|
|
26
26
|
"html-entities": "2.6.0",
|
|
27
27
|
"node-email-verifier": "4.0.0",
|
|
28
|
-
"@tryghost/mg-utils": "0.
|
|
28
|
+
"@tryghost/mg-utils": "0.11.0"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"dev": "echo \"Implement me!\"",
|