anki/ts/patches/protobufjs+6.11.3.patch

39 lines
1.6 KiB
Diff

diff --git a/node_modules/protobufjs/cli/util.js b/node_modules/protobufjs/cli/util.js
index ffce1ed..c87a4b4 100644
--- a/node_modules/protobufjs/cli/util.js
+++ b/node_modules/protobufjs/cli/util.js
@@ -133,6 +133,7 @@ function modInstall(install) {
}
exports.setup = function() {
+ return;
var pkg = require(path.join(__dirname, "..", "package.json"));
var version = pkg.dependencies["semver"] || pkg.devDependencies["semver"];
if (!modExists("semver", version)) {
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.