@prismicio/types-internal 3.2.0-alpha.0 → 3.2.0-alpha.1

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.
@@ -183,7 +183,7 @@ function traverseDocument({ document, customType, }) {
183
183
  key,
184
184
  apiId: key,
185
185
  model: (fieldModel === null || fieldModel === void 0 ? void 0 : fieldModel.type) === "Link" && ((_a = fieldModel.config) === null || _a === void 0 ? void 0 : _a.repeat)
186
- ? fieldModel
186
+ ? { ...fieldModel, config: { ...fieldModel.config, repeat: false } }
187
187
  : undefined,
188
188
  content,
189
189
  })(transformWidget);
@@ -62,15 +62,11 @@ function traverseRepeatableContent({ path, key, apiId, model, content, }) {
62
62
  const itemPath = path.concat([
63
63
  { key: index.toString(), type: "Widget" },
64
64
  ]);
65
- const overriddenModel = model;
66
- if ((overriddenModel === null || overriddenModel === void 0 ? void 0 : overriddenModel.config) && overriddenModel.type === "Link") {
67
- overriddenModel.config.repeat = false;
68
- }
69
65
  const transformedField = transform({
70
66
  path: itemPath,
71
67
  key: key,
72
68
  apiId: apiId,
73
- model: overriddenModel,
69
+ model,
74
70
  content: fieldContent,
75
71
  });
76
72
  // Can happen if the transform function returns undefined to filter out a field
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/types-internal",
3
- "version": "3.2.0-alpha.0",
3
+ "version": "3.2.0-alpha.1",
4
4
  "description": "Prismic types for Custom Types and Prismic Data",
5
5
  "keywords": [
6
6
  "typescript",
@@ -301,7 +301,7 @@ export function traverseDocument({
301
301
  apiId: key,
302
302
  model:
303
303
  fieldModel?.type === "Link" && fieldModel.config?.repeat
304
- ? fieldModel
304
+ ? { ...fieldModel, config: { ...fieldModel.config, repeat: false } }
305
305
  : undefined,
306
306
  content,
307
307
  })(transformWidget)
@@ -113,16 +113,11 @@ export function traverseRepeatableContent({
113
113
  { key: index.toString(), type: "Widget" },
114
114
  ])
115
115
 
116
- const overriddenModel = model
117
- if (overriddenModel?.config && overriddenModel.type === "Link") {
118
- overriddenModel.config.repeat = false
119
- }
120
-
121
116
  const transformedField = transform({
122
117
  path: itemPath,
123
118
  key: key,
124
119
  apiId: apiId,
125
- model: overriddenModel,
120
+ model,
126
121
  content: fieldContent,
127
122
  })
128
123