Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose experimental edition features in descriptor sets #627

Merged
merged 7 commits into from
Nov 28, 2023
Merged
Prev Previous commit
Next Next commit
Automatically pick up new known features invalidateMergedFeatures
  • Loading branch information
timostamm committed Nov 27, 2023
commit ad1965dc2ffff83e845e108520289a70032489d8
15 changes: 6 additions & 9 deletions packages/protobuf/src/private/feature-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,12 @@ export function createFeatureResolver(
function validateMergedFeatures(
featureSet: FeatureSet,
): featureSet is MergedFeatureSet {
for (const p of [
"fieldPresence",
"enumType",
"repeatedFieldEncoding",
"utf8Validation",
"messageEncoding",
"jsonFormat",
] as const) {
if (featureSet[p] === undefined || (featureSet[p] as number) === 0) {
for (const fi of FeatureSet.fields.list()) {
const v = featureSet[fi.localName as keyof FeatureSet];
if (v === undefined) {
return false;
}
if (fi.kind == "enum" && v === 0) {
return false;
}
}
Expand Down