@prismicio/types-internal
Advanced tools
Comparing version 0.2.9 to 0.2.10
@@ -17,4 +17,5 @@ "use strict"; | ||
const sorted = Object.entries(jsItem).sort(([k1], [k2]) => { | ||
const p1 = fieldPositions.get(`${prefixedKey}.${k1}`) ?? 10000; | ||
const p2 = fieldPositions.get(`${prefixedKey}.${k2}`) ?? 10000; | ||
var _a, _b; | ||
const p1 = (_a = fieldPositions.get(`${prefixedKey}.${k1}`)) !== null && _a !== void 0 ? _a : 10000; | ||
const p2 = (_b = fieldPositions.get(`${prefixedKey}.${k2}`)) !== null && _b !== void 0 ? _b : 10000; | ||
return p1 - p2; | ||
@@ -21,0 +22,0 @@ }); |
@@ -8,5 +8,5 @@ "use strict"; | ||
exports.BooleanContentType = "BooleanContent"; | ||
const BooleanContent = new t.Type("BooleanContent", (u) => u?.__TYPE__ === exports.BooleanContentType, (u, c) => Either_1.Chain.chain(t.boolean.validate(u, c), (u) => { | ||
const BooleanContent = new t.Type("BooleanContent", (u) => { var _a; return ((_a = u) === null || _a === void 0 ? void 0 : _a.__TYPE__) === exports.BooleanContentType; }, (u, c) => Either_1.Chain.chain(t.boolean.validate(u, c), (u) => { | ||
return t.success({ value: u, __TYPE__: exports.BooleanContentType }); | ||
}), (booleanContent) => t.boolean.encode(booleanContent.value)); | ||
exports.default = BooleanContent; |
@@ -8,3 +8,3 @@ "use strict"; | ||
exports.IntegrationFieldsContentType = "IntegrationFieldsContent"; | ||
const IntegrationFieldsContent = new t.Type("IntegrationFieldsContent", (u) => u?.__TYPE__ === exports.IntegrationFieldsContentType, (u, c) => Either_1.Chain.chain(t.string.validate(u, c), (u) => { | ||
const IntegrationFieldsContent = new t.Type("IntegrationFieldsContent", (u) => { var _a; return ((_a = u) === null || _a === void 0 ? void 0 : _a.__TYPE__) === exports.IntegrationFieldsContentType; }, (u, c) => Either_1.Chain.chain(t.string.validate(u, c), (u) => { | ||
return t.success({ | ||
@@ -11,0 +11,0 @@ value: u, |
@@ -10,5 +10,6 @@ "use strict"; | ||
exports.LinkContent = new t.Type("LinkContent", (u) => { | ||
return index_1.Link.is(u?.value); | ||
var _a; | ||
return index_1.Link.is((_a = u) === null || _a === void 0 ? void 0 : _a.value); | ||
}, (u, c) => Either_1.Chain.chain(index_1.Link.validate(u, c), (u) => { | ||
return t.success({ value: u, __TYPE__: exports.LinkContentType }); | ||
}), (linkContent) => index_1.Link.encode(linkContent.value)); |
@@ -9,3 +9,3 @@ "use strict"; | ||
exports.StructuredTextContentType = "StructuredTextContent"; | ||
exports.StructuredTextContent = new t.Type(exports.StructuredTextContentType, (u) => u?.__TYPE__ === exports.StructuredTextContentType, (u, c) => Either_1.Chain.chain(t.array(Block_1.Block).validate(u, c), (u) => { | ||
exports.StructuredTextContent = new t.Type(exports.StructuredTextContentType, (u) => { var _a; return ((_a = u) === null || _a === void 0 ? void 0 : _a.__TYPE__) === exports.StructuredTextContentType; }, (u, c) => Either_1.Chain.chain(t.array(Block_1.Block).validate(u, c), (u) => { | ||
return t.success({ value: u, __TYPE__: exports.StructuredTextContentType }); | ||
@@ -12,0 +12,0 @@ }), () => { |
@@ -16,2 +16,3 @@ "use strict"; | ||
fromJson: (prefixes, key, value, fieldTypes, fieldPositions) => { | ||
var _a; | ||
const prefixedRepeatKey = Array.of(prefixes, [key, "repeat"]) | ||
@@ -23,7 +24,8 @@ .flat() | ||
const repeatObj = decodedValue.right.repeat; | ||
const nonRepeatObj = decodedValue.right["non-repeat"] ?? {}; | ||
const nonRepeatObj = (_a = decodedValue.right["non-repeat"]) !== null && _a !== void 0 ? _a : {}; | ||
const groupItemsContentsRepeat = index_1.GroupContent.itemsContentsFromJson(prefixedRepeatKey, repeatObj, fieldTypes, fieldPositions); | ||
const sortedFields = Object.entries(nonRepeatObj).sort(([k1], [k2]) => { | ||
const p1 = fieldPositions.get(`${Array.of(prefixes, [key]).flat().join(".")}.${k1}`) ?? 10000; | ||
const p2 = fieldPositions.get(`${Array.of(prefixes, [key]).flat().join(".")}.${k2}`) ?? 10000; | ||
var _a, _b; | ||
const p1 = (_a = fieldPositions.get(`${Array.of(prefixes, [key]).flat().join(".")}.${k1}`)) !== null && _a !== void 0 ? _a : 10000; | ||
const p2 = (_b = fieldPositions.get(`${Array.of(prefixes, [key]).flat().join(".")}.${k2}`)) !== null && _b !== void 0 ? _b : 10000; | ||
return p1 - p2; | ||
@@ -30,0 +32,0 @@ }); |
@@ -29,4 +29,5 @@ "use strict"; | ||
const sortedFields = Object.entries(v.primary).sort(([k1], [k2]) => { | ||
const p1 = fieldPositions.get(`${Array.of(prefixes, [key]).flat().join(".")}.${k1}`) ?? 10000; | ||
const p2 = fieldPositions.get(`${Array.of(prefixes, [key]).flat().join(".")}.${k2}`) ?? 10000; | ||
var _a, _b; | ||
const p1 = (_a = fieldPositions.get(`${Array.of(prefixes, [key]).flat().join(".")}.${k1}`)) !== null && _a !== void 0 ? _a : 10000; | ||
const p2 = (_b = fieldPositions.get(`${Array.of(prefixes, [key]).flat().join(".")}.${k2}`)) !== null && _b !== void 0 ? _b : 10000; | ||
return p1 - p2; | ||
@@ -33,0 +34,0 @@ }); |
@@ -28,6 +28,7 @@ "use strict"; | ||
return O.map((widget) => { | ||
var _a; | ||
return { | ||
key: r.key, | ||
name, | ||
maybeLabel: r.label ?? undefined, | ||
maybeLabel: (_a = r.label) !== null && _a !== void 0 ? _a : undefined, | ||
widget: widget, | ||
@@ -34,0 +35,0 @@ }; |
@@ -8,4 +8,4 @@ "use strict"; | ||
exports.UIDContentType = "UIDContent"; | ||
exports.UIDContent = new t.Type("UIDContent", (u) => u?.__TYPE__ === exports.UIDContentType, (u, c) => Either_1.Chain.chain(t.string.validate(u, c), (u) => { | ||
exports.UIDContent = new t.Type("UIDContent", (u) => { var _a; return ((_a = u) === null || _a === void 0 ? void 0 : _a.__TYPE__) === exports.UIDContentType; }, (u, c) => Either_1.Chain.chain(t.string.validate(u, c), (u) => { | ||
return t.success({ value: u, __TYPE__: "UIDContent" }); | ||
}), (uidContent) => uidContent.value); |
{ | ||
"name": "@prismicio/types-internal", | ||
"version": "0.2.9", | ||
"version": "0.2.10", | ||
"description": "Prismic types for Custom Types and Prismic Data", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
837085
19343