@prismicio/types-internal 3.17.0-alpha.2 → 3.17.0-alpha.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.
package/lib/content/utils.js
CHANGED
|
@@ -25,7 +25,7 @@ const uuidWithFallback = new t.Type("UUID", isUuid, (u, c) => {
|
|
|
25
25
|
return t.success((0, uuid_1.v4)());
|
|
26
26
|
if (isUuid(u))
|
|
27
27
|
return t.success(u);
|
|
28
|
-
return t.failure(u, c);
|
|
28
|
+
return t.failure(u, c, "Expected a valid UUID v4 string");
|
|
29
29
|
}, t.identity);
|
|
30
30
|
function withKey(codec) {
|
|
31
31
|
return t.intersection([t.strict({ key: uuidWithFallback }), codec]);
|
|
@@ -2239,7 +2239,6 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
2239
2239
|
page: string;
|
|
2240
2240
|
custom: string;
|
|
2241
2241
|
}>;
|
|
2242
|
-
route: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
2243
2242
|
}>]>>;
|
|
2244
2243
|
export declare type StaticCustomType = t.TypeOf<typeof StaticCustomType>;
|
|
2245
2244
|
export declare const CustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
@@ -3661,7 +3660,6 @@ export declare const CustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
3661
3660
|
page: string;
|
|
3662
3661
|
custom: string;
|
|
3663
3662
|
}>;
|
|
3664
|
-
route: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
3665
3663
|
}>]>>;
|
|
3666
3664
|
export declare type CustomType = t.TypeOf<typeof CustomType>;
|
|
3667
3665
|
export declare function flattenWidgets(customType: CustomType): Array<[string, DynamicWidget]>;
|
package/package.json
CHANGED
package/src/content/utils.ts
CHANGED
|
@@ -43,7 +43,7 @@ const uuidWithFallback = new t.Type<string, string, unknown>(
|
|
|
43
43
|
(u, c) => {
|
|
44
44
|
if (typeof u === "undefined") return t.success(uuid())
|
|
45
45
|
if (isUuid(u)) return t.success(u)
|
|
46
|
-
return t.failure(u, c)
|
|
46
|
+
return t.failure(u, c, "Expected a valid UUID v4 string")
|
|
47
47
|
},
|
|
48
48
|
t.identity,
|
|
49
49
|
)
|