@paroicms/site-generator-plugin 0.33.1 → 0.33.3

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,7 @@ export async function updateSiteFields(ctx, _report, options) {
19
19
  }
20
20
  for (const fieldName of ["favicon", "ogImage", "logo"]) {
21
21
  const fieldType = siteType.fields.find((f) => f.name === fieldName);
22
- if (!fieldType || fieldType.storedAs !== "mediaHandle")
22
+ if (fieldType?.storedAs !== "mediaHandle")
23
23
  continue;
24
24
  await siteConnector.setMedia({
25
25
  handle: getHandleOfSiteField(fieldName),
@@ -38,7 +38,7 @@ function getRoutingKeyInCluster(ctx, documentType, options) {
38
38
  if (current === target)
39
39
  return currentPath;
40
40
  const node = getNodeType(current);
41
- if (!node || node.kind !== "document" || !node.routingChildren)
41
+ if (node?.kind !== "document" || !node.routingChildren)
42
42
  return;
43
43
  for (const childName of node.routingChildren) {
44
44
  const found = findPath(target, childName, currentPath);
@@ -91,9 +91,7 @@ function getLabeledDocuments(siteSchema, getParentTypes) {
91
91
  if (typeof field === "string" || field.storedAs !== "labeling")
92
92
  continue;
93
93
  const taxonomyType = siteSchema.nodeTypes?.find((nt) => nt.typeName === field.taxonomy);
94
- if (!taxonomyType ||
95
- taxonomyType.kind !== "document" ||
96
- taxonomyType.documentKind !== "routing") {
94
+ if (taxonomyType?.kind !== "document" || taxonomyType.documentKind !== "routing") {
97
95
  continue;
98
96
  }
99
97
  for (const parentDocumentType of getParentTypes(documentType)) {