anki/ts/patches/protobufjs+6.11.2.patch

27 lines
1.1 KiB
Diff
Raw Normal View History

diff --git a/node_modules/protobufjs/src/field.js b/node_modules/protobufjs/src/field.js
index 20c1cd2..3a1395f 100644
--- a/node_modules/protobufjs/src/field.js
+++ b/node_modules/protobufjs/src/field.js
@@ -270,6 +270,8 @@ Field.prototype.resolve = function resolve() {
this.typeDefault = null;
else // instanceof Enum
this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined
+ } else if (this.options && this.options.proto3_optional) {
+ this.typeDefault = null;
}
// use explicitly set default value if present
diff --git a/node_modules/protobufjs/src/root.js b/node_modules/protobufjs/src/root.js
index df6f11f..112f9e8 100644
--- a/node_modules/protobufjs/src/root.js
+++ b/node_modules/protobufjs/src/root.js
@@ -259,7 +259,7 @@ Root.prototype.resolveAll = function resolveAll() {
};
// only uppercased (and thus conflict-free) children are exposed, see below
-var exposeRe = /^[A-Z]/;
+var exposeRe = /^[A-Za-z]/;
/**
* Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.