@tryghost/mg-json 0.11.1 → 0.11.2

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.
@@ -140,7 +140,9 @@ export default (json) => {
140
140
  }
141
141
  };
142
142
 
143
- json.posts.forEach(processPostRelations);
143
+ if (json.posts) {
144
+ json.posts.forEach(processPostRelations);
145
+ }
144
146
 
145
147
  return json;
146
148
  };
@@ -1,4 +1,8 @@
1
1
  export default (json) => {
2
+ if (!json.posts) {
3
+ return json;
4
+ }
5
+
2
6
  json.posts.forEach((post) => {
3
7
  let tags = post.data.tags || [];
4
8
  let publicTags = [];
@@ -1,4 +1,8 @@
1
1
  export default (json, ctx = null) => {
2
+ if (!json.posts) {
3
+ return json;
4
+ }
5
+
2
6
  json.posts.forEach((item, index) => {
3
7
  let input = item.data;
4
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/mg-json",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "repository": "https://github.com/TryGhost/migrate/tree/main/packages/mg-json",
5
5
  "author": "Ghost Foundation",
6
6
  "license": "MIT",
@@ -25,10 +25,10 @@
25
25
  "jest-extended": "4.0.2"
26
26
  },
27
27
  "dependencies": {
28
- "@tryghost/string": "0.2.11",
28
+ "@tryghost/string": "0.2.12",
29
29
  "bson-objectid": "2.0.4",
30
30
  "html-entities": "2.5.2",
31
31
  "lodash": "4.17.21"
32
32
  },
33
- "gitHead": "11cc97db15efc3e19af16253cd53694cf72aa55d"
33
+ "gitHead": "f824cede3d1123defe3e4575536dd579984f7fe2"
34
34
  }