@thg-altitude/schemaorg 1.0.17 → 1.0.18

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/.idea/misc.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager">
4
+ <output url="file://$PROJECT_DIR$/out" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/schemaorg.iml" filepath="$PROJECT_DIR$/.idea/schemaorg.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="JAVA_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$" />
6
+ <orderEntry type="inheritedJdk" />
7
+ <orderEntry type="sourceFolder" forTests="false" />
8
+ </component>
9
+ </module>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thg-altitude/schemaorg",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -13,4 +13,4 @@
13
13
  "dependencies": {
14
14
  "astro": "^3.0.12"
15
15
  }
16
- }
16
+ }
@@ -35,6 +35,12 @@ Astro.props.reviews?.forEach((review)=>{
35
35
  })
36
36
  })
37
37
 
38
+ let aggregateRating = Astro.props.reviewsCount > 0 ? {
39
+ "@type": "AggregateRating",
40
+ "ratingValue": Astro.props.reviewsAverage,
41
+ "reviewCount": Astro.props.reviewsCount
42
+ } : undefined
43
+
38
44
  let schema = {
39
45
  "@type": "Product",
40
46
  "@context": "https://schema.org",
@@ -47,11 +53,7 @@ let schema = {
47
53
  "@type": "Brand",
48
54
  "name": Astro.props.brand,
49
55
  },
50
- "aggregateRating": {
51
- "@type": "AggregateRating",
52
- "ratingValue": Astro.props.reviewsAverage,
53
- "reviewCount": Astro.props.reviewsCount
54
- },
56
+ "aggregateRating": aggregateRating,
55
57
  "review": reviewsArray,
56
58
  "offers": offersArray
57
59
  };