@tryghost/algolia-fragmenter 0.2.1 → 0.2.4

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2013-2021 Ghost Foundation
3
+ Copyright (c) 2013-2022 Ghost Foundation
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -38,4 +38,4 @@ Follow the instructions for the top-level repo.
38
38
 
39
39
  # Copyright & License
40
40
 
41
- Copyright (c) 2013-2021 Ghost Foundation - Released under the [MIT license](LICENSE).
41
+ Copyright (c) 2013-2022 Ghost Foundation - Released under the [MIT license](LICENSE).
@@ -99,15 +99,21 @@ module.exports.transformToAlgoliaObject = (posts, ignoreSlugs) => {
99
99
  }
100
100
  }
101
101
 
102
- post.tags.forEach((tag) => {
103
- algoliaPost.tags.push({name: tag.name, slug: tag.slug});
104
- });
102
+ if (post.tags && post.tags.length) {
103
+ post.tags.forEach((tag) => {
104
+ algoliaPost.tags.push({name: tag.name, slug: tag.slug});
105
+ });
106
+ }
105
107
 
106
- post.authors.forEach((author) => {
107
- algoliaPost.authors.push({name: author.name, slug: author.slug});
108
- });
108
+ if (post.authors && post.authors.length) {
109
+ post.authors.forEach((author) => {
110
+ algoliaPost.authors.push({name: author.name, slug: author.slug});
111
+ });
112
+ }
109
113
 
110
114
  algoliaObjects.push(algoliaPost);
115
+
116
+ return algoliaPost;
111
117
  });
112
118
 
113
119
  return algoliaObjects;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/algolia-fragmenter",
3
- "version": "0.2.1",
3
+ "version": "0.2.4",
4
4
  "repository": "https://github.com/TryGhost/algolia/tree/master/packages/algolia-fragmenter",
5
5
  "author": "Ghost Foundation",
6
6
  "license": "MIT",
@@ -19,12 +19,12 @@
19
19
  "access": "public"
20
20
  },
21
21
  "devDependencies": {
22
- "mocha": "7.1.2",
22
+ "mocha": "10.0.0",
23
23
  "should": "13.2.3",
24
- "sinon": "9.0.2"
24
+ "sinon": "14.0.0"
25
25
  },
26
26
  "dependencies": {
27
27
  "algolia-html-extractor": "0.0.1"
28
28
  },
29
- "gitHead": "2e2b7fba7c8a640251e2d98d0cc84656c2e4cb02"
29
+ "gitHead": "11fe8cbd14c79f283e09dc10f413b11058993232"
30
30
  }