Skip to content

Commit da9fdd2

Browse files
fix(types): bring back Field.rule to .d.ts
1 parent a2ccda1 commit da9fdd2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/field.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ function Field(name, id, type, rule, extend, options, comment) {
7878
if (extend !== undefined && !util.isString(extend))
7979
throw TypeError("extend must be a string");
8080

81+
if (rule === "proto3_optional") {
82+
rule = "optional";
83+
}
8184
/**
8285
* Field rule, if any.
8386
* @type {string|undefined}
8487
*/
85-
if (rule === "proto3_optional") {
86-
rule = "optional";
87-
}
8888
this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON
8989

9090
/**

0 commit comments

Comments
 (0)