protobufjs 8.5.0 → 8.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -57
- package/dist/light/protobuf.js +159 -121
- package/dist/light/protobuf.js.map +1 -1
- package/dist/light/protobuf.min.js +3 -3
- package/dist/light/protobuf.min.js.map +1 -1
- package/dist/minimal/protobuf.js +26 -69
- package/dist/minimal/protobuf.js.map +1 -1
- package/dist/minimal/protobuf.min.js +3 -3
- package/dist/minimal/protobuf.min.js.map +1 -1
- package/dist/protobuf.js +174 -122
- package/dist/protobuf.js.map +1 -1
- package/dist/protobuf.min.js +3 -3
- package/dist/protobuf.min.js.map +1 -1
- package/ext/README.md +38 -49
- package/ext/descriptor.d.ts +8 -7
- package/ext/descriptor.generated.d.ts +16 -8
- package/ext/descriptor.js +170 -104
- package/ext/protojson.LICENSE +201 -0
- package/ext/protojson.d.ts +20 -0
- package/ext/protojson.generated.d.ts +49 -0
- package/ext/protojson.js +925 -0
- package/ext/textformat.d.ts +2 -2
- package/ext/textformat.generated.d.ts +22 -0
- package/ext/textformat.js +40 -19
- package/index.d.ts +35 -17
- package/package.json +2 -6
- package/src/converter.js +3 -3
- package/src/decoder.js +2 -2
- package/src/encoder.js +1 -1
- package/src/field.js +49 -7
- package/src/mapfield.js +16 -7
- package/src/parse.js +15 -1
- package/src/service.js +5 -7
- package/src/type.js +12 -3
- package/src/util/minimal.js +1 -4
- package/src/util.js +23 -0
- package/src/verifier.js +2 -2
- package/scripts/postinstall.js +0 -32
- package/src/util/inquire.d.ts +0 -10
- package/src/util/inquire.js +0 -38
package/scripts/postinstall.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var path = require("path"),
|
|
4
|
-
fs = require("fs"),
|
|
5
|
-
pkg = require(path.join(__dirname, "..", "package.json"));
|
|
6
|
-
|
|
7
|
-
// check version scheme used by dependents
|
|
8
|
-
if (!pkg.versionScheme)
|
|
9
|
-
return;
|
|
10
|
-
|
|
11
|
-
var warn = process.stderr.isTTY
|
|
12
|
-
? "\x1b[30m\x1b[43mWARN\x1b[0m \x1b[35m" + path.basename(process.argv[1], ".js") + "\x1b[0m"
|
|
13
|
-
: "WARN " + path.basename(process.argv[1], ".js");
|
|
14
|
-
|
|
15
|
-
var basePkg;
|
|
16
|
-
try {
|
|
17
|
-
basePkg = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "..", "package.json")));
|
|
18
|
-
} catch (e) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
[
|
|
23
|
-
"dependencies",
|
|
24
|
-
"devDependencies",
|
|
25
|
-
"optionalDependencies",
|
|
26
|
-
"peerDependencies"
|
|
27
|
-
]
|
|
28
|
-
.forEach(function(check) {
|
|
29
|
-
var version = basePkg && basePkg[check] && basePkg[check][pkg.name];
|
|
30
|
-
if (typeof version === "string" && version.charAt(0) !== pkg.versionScheme)
|
|
31
|
-
process.stderr.write(pkg.name + " " + warn + " " + pkg.name + "@" + version + " is configured as a dependency of " + basePkg.name + ". use " + pkg.name + "@" + pkg.versionScheme + version.substring(1) + " instead for API compatibility.\n");
|
|
32
|
-
});
|
package/src/util/inquire.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export = inquire;
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Requires a module only if available.
|
|
5
|
-
* @memberof util
|
|
6
|
-
* @param {string} moduleName Module to require
|
|
7
|
-
* @returns {?Object} Required module if available and not empty, otherwise `null`
|
|
8
|
-
* @deprecated Legacy optional require helper. Will be removed in a future release.
|
|
9
|
-
*/
|
|
10
|
-
declare function inquire(moduleName: string): object;
|
package/src/util/inquire.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
module.exports = inquire;
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Requires a module only if available.
|
|
6
|
-
* @memberof util
|
|
7
|
-
* @param {string} moduleName Module to require
|
|
8
|
-
* @returns {?Object} Required module if available and not empty, otherwise `null`
|
|
9
|
-
* @deprecated Legacy optional require helper. Will be removed in a future release.
|
|
10
|
-
*/
|
|
11
|
-
function inquire(moduleName) {
|
|
12
|
-
try {
|
|
13
|
-
if (typeof require !== "function") {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
var mod = require(moduleName);
|
|
17
|
-
if (mod && (mod.length || Object.keys(mod).length)) return mod;
|
|
18
|
-
return null;
|
|
19
|
-
} catch (err) {
|
|
20
|
-
// ignore
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/*
|
|
26
|
-
// maybe worth a shot to prevent renaming issues:
|
|
27
|
-
// see: https://github.com/webpack/webpack/blob/master/lib/dependencies/CommonJsRequireDependencyParserPlugin.js
|
|
28
|
-
// triggers on:
|
|
29
|
-
// - expression require.cache
|
|
30
|
-
// - expression require (???)
|
|
31
|
-
// - call require
|
|
32
|
-
// - call require:commonjs:item
|
|
33
|
-
// - call require:commonjs:context
|
|
34
|
-
|
|
35
|
-
Object.defineProperty(Function.prototype, "__self", { get: function() { return this; } });
|
|
36
|
-
var r = require.__self;
|
|
37
|
-
delete Function.prototype.__self;
|
|
38
|
-
*/
|