@prismicio/types-internal 1.1.0 → 1.1.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.
@@ -26,7 +26,7 @@ exports.WidgetTypes = {
26
26
  slices: slices_1.SlicesContentType,
27
27
  };
28
28
  const widgetKeyRegex = new RegExp("^[^<>]+$");
29
- exports.WidgetKey = (0, function_1.refineType)(t.string, "WidgetKey", (s) => widgetKeyRegex.test(s));
29
+ exports.WidgetKey = (0, function_1.refineType)(t.string, "WidgetKey", (s) => s.length === 0 || widgetKeyRegex.test(s));
30
30
  exports.Widget = {
31
31
  fromJson(widgetKey, widgetValue, widgetTypes, widgetPositions) {
32
32
  const fieldType = widgetTypes.get(widgetKey);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/types-internal",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Prismic types for Custom Types and Prismic Data",
5
5
  "keywords": [
6
6
  "typescript",
@@ -32,7 +32,7 @@ export type WidgetTypes = typeof WidgetTypes[keyof typeof WidgetTypes]
32
32
  const widgetKeyRegex = new RegExp("^[^<>]+$")
33
33
 
34
34
  export const WidgetKey = refineType(t.string, "WidgetKey", (s: string) =>
35
- widgetKeyRegex.test(s),
35
+ s.length === 0 || widgetKeyRegex.test(s),
36
36
  )
37
37
 
38
38
  export type WidgetKey = t.TypeOf<typeof WidgetKey>