@prismicio/types-internal 0.2.8 → 0.2.9

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.
@@ -6,7 +6,6 @@ const Either_1 = require("fp-ts/lib/Either");
6
6
  const t = (0, tslib_1.__importStar)(require("io-ts"));
7
7
  const withFallback_1 = require("io-ts-types/lib/withFallback");
8
8
  const validators_1 = require("../validators");
9
- const Format_1 = require("./Format");
10
9
  const Section_1 = require("./Section");
11
10
  const SlicesTypes_1 = (0, tslib_1.__importDefault)(require("./widgets/slices/SlicesTypes"));
12
11
  const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("./widgets/WidgetTypes"));
@@ -35,13 +34,13 @@ ${slicesMsg.join("\n")}
35
34
  `;
36
35
  }
37
36
  }
38
- function customTypeReader(format) {
37
+ function customTypeReader(codec) {
39
38
  return t.exact(t.intersection([
40
39
  t.type({
41
40
  id: t.string,
42
41
  label: validators_1.StringOrNull,
43
42
  repeatable: (0, withFallback_1.withFallback)(t.boolean, true),
44
- json: t.record(t.string, (0, Section_1.sectionReader)(format)),
43
+ json: t.record(t.string, codec),
45
44
  status: (0, withFallback_1.withFallback)(t.boolean, true),
46
45
  }),
47
46
  t.partial({
@@ -49,8 +48,8 @@ function customTypeReader(format) {
49
48
  }),
50
49
  ]));
51
50
  }
52
- exports.StaticCustomType = customTypeReader(Format_1.Format.Static);
53
- exports.CustomType = customTypeReader(Format_1.Format.Dynamic);
51
+ exports.StaticCustomType = customTypeReader(Section_1.StaticSection);
52
+ exports.CustomType = customTypeReader(Section_1.DynamicSection);
54
53
  function flattenWidgets(customType) {
55
54
  return Object.entries(customType.json).reduce((acc, [, section]) => {
56
55
  const sectionWidgets = Object.entries(section);