@msgpack/msgpack
Advanced tools
Comparing version 2.1.1 to 2.2.0
This is the revision history of @msgpack/msgpack | ||
## v2.2.0 2020/10/04 | ||
https://github.com/msgpack/msgpack-javascript/compare/v2.1.1...v2.2.0 | ||
* Now `package.json` has a `module` field to support ES modules | ||
## v2.1.1 2020/10/04 | ||
@@ -4,0 +10,0 @@ |
@@ -1,14 +0,22 @@ | ||
export { encode, EncodeOptions } from "./encode"; | ||
export { decode, DecodeOptions } from "./decode"; | ||
export { decodeAsync, decodeArrayStream, decodeStream } from "./decodeAsync"; | ||
/** | ||
* @experimental `Decoder` is exported for experimental use. | ||
*/ | ||
export { Decoder } from "./Decoder"; | ||
/** | ||
* @experimental `Encoder` is exported for experimental use. | ||
*/ | ||
export { Encoder } from "./Encoder"; | ||
export { ExtensionCodec, ExtensionCodecType, ExtensionDecoderType, ExtensionEncoderType } from "./ExtensionCodec"; | ||
export { ExtData } from "./ExtData"; | ||
export { EXT_TIMESTAMP, encodeDateToTimeSpec, encodeTimeSpecToTimestamp, decodeTimestampToTimeSpec, encodeTimestampExtension, decodeTimestampExtension, } from "./timestamp"; | ||
import { encode } from "./encode"; | ||
export { encode }; | ||
import type { EncodeOptions } from "./encode"; | ||
export type { EncodeOptions }; | ||
import { decode } from "./decode"; | ||
export { decode }; | ||
import type { DecodeOptions } from "./decode"; | ||
export { DecodeOptions }; | ||
import { decodeAsync, decodeArrayStream, decodeStream } from "./decodeAsync"; | ||
export { decodeAsync, decodeArrayStream, decodeStream }; | ||
import { Decoder } from "./Decoder"; | ||
export { Decoder }; | ||
import { Encoder } from "./Encoder"; | ||
export { Encoder }; | ||
import { ExtensionCodec } from "./ExtensionCodec"; | ||
export { ExtensionCodec }; | ||
import type { ExtensionCodecType, ExtensionDecoderType, ExtensionEncoderType } from "./ExtensionCodec"; | ||
export type { ExtensionCodecType, ExtensionDecoderType, ExtensionEncoderType }; | ||
import { ExtData } from "./ExtData"; | ||
export { ExtData }; | ||
import { EXT_TIMESTAMP, encodeDateToTimeSpec, encodeTimeSpecToTimestamp, decodeTimestampToTimeSpec, encodeTimestampExtension, decodeTimestampExtension } from "./timestamp"; | ||
export { EXT_TIMESTAMP, encodeDateToTimeSpec, encodeTimeSpecToTimestamp, decodeTimestampToTimeSpec, encodeTimestampExtension, decodeTimestampExtension, }; |
@@ -5,26 +5,20 @@ "use strict"; | ||
exports.decodeTimestampExtension = exports.encodeTimestampExtension = exports.decodeTimestampToTimeSpec = exports.encodeTimeSpecToTimestamp = exports.encodeDateToTimeSpec = exports.EXT_TIMESTAMP = exports.ExtData = exports.ExtensionCodec = exports.Encoder = exports.Decoder = exports.decodeStream = exports.decodeArrayStream = exports.decodeAsync = exports.decode = exports.encode = void 0; | ||
var encode_1 = require("./encode"); | ||
const encode_1 = require("./encode"); | ||
Object.defineProperty(exports, "encode", { enumerable: true, get: function () { return encode_1.encode; } }); | ||
var decode_1 = require("./decode"); | ||
const decode_1 = require("./decode"); | ||
Object.defineProperty(exports, "decode", { enumerable: true, get: function () { return decode_1.decode; } }); | ||
var decodeAsync_1 = require("./decodeAsync"); | ||
const decodeAsync_1 = require("./decodeAsync"); | ||
Object.defineProperty(exports, "decodeAsync", { enumerable: true, get: function () { return decodeAsync_1.decodeAsync; } }); | ||
Object.defineProperty(exports, "decodeArrayStream", { enumerable: true, get: function () { return decodeAsync_1.decodeArrayStream; } }); | ||
Object.defineProperty(exports, "decodeStream", { enumerable: true, get: function () { return decodeAsync_1.decodeStream; } }); | ||
/** | ||
* @experimental `Decoder` is exported for experimental use. | ||
*/ | ||
var Decoder_1 = require("./Decoder"); | ||
const Decoder_1 = require("./Decoder"); | ||
Object.defineProperty(exports, "Decoder", { enumerable: true, get: function () { return Decoder_1.Decoder; } }); | ||
/** | ||
* @experimental `Encoder` is exported for experimental use. | ||
*/ | ||
var Encoder_1 = require("./Encoder"); | ||
const Encoder_1 = require("./Encoder"); | ||
Object.defineProperty(exports, "Encoder", { enumerable: true, get: function () { return Encoder_1.Encoder; } }); | ||
// Utilitiies for Extension Types: | ||
var ExtensionCodec_1 = require("./ExtensionCodec"); | ||
const ExtensionCodec_1 = require("./ExtensionCodec"); | ||
Object.defineProperty(exports, "ExtensionCodec", { enumerable: true, get: function () { return ExtensionCodec_1.ExtensionCodec; } }); | ||
var ExtData_1 = require("./ExtData"); | ||
const ExtData_1 = require("./ExtData"); | ||
Object.defineProperty(exports, "ExtData", { enumerable: true, get: function () { return ExtData_1.ExtData; } }); | ||
var timestamp_1 = require("./timestamp"); | ||
const timestamp_1 = require("./timestamp"); | ||
Object.defineProperty(exports, "EXT_TIMESTAMP", { enumerable: true, get: function () { return timestamp_1.EXT_TIMESTAMP; } }); | ||
@@ -31,0 +25,0 @@ Object.defineProperty(exports, "encodeDateToTimeSpec", { enumerable: true, get: function () { return timestamp_1.encodeDateToTimeSpec; } }); |
{ | ||
"name": "@msgpack/msgpack", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "MessagePack for JavaScript/ECMA-262", | ||
@@ -8,3 +8,4 @@ "author": "The MessagePack community", | ||
"main": "./dist/index.js", | ||
"browser": "./dist.es5/msgpack.min.js", | ||
"browser": "./dist.es5+umd/msgpack.min.js", | ||
"module": "./dist.es5+esm/index.js", | ||
"types": "./dist/index.d.ts", | ||
@@ -14,3 +15,3 @@ "sideEffects": false, | ||
"build": "npm publish --dry-run", | ||
"prepare": "npm run clean && tsc -p tsconfig.dist.json && webpack", | ||
"prepare": "npm run clean && webpack && tsc --build tsconfig.dist.json tsconfig.dist.es5+esm.json && ts-node tools/esmify.ts dist.es5+esm/*.js dist.es5+esm/*/*.js", | ||
"prepublishOnly": "run-p 'test:dist:*' && npm run test:browser", | ||
@@ -93,4 +94,5 @@ "clean": "rimraf build dist dist.*", | ||
"dist/**/*.*", | ||
"dist.es5/**/*.*" | ||
"dist.es5+umd/**/*.*", | ||
"dist.es5+esm/**/*.*" | ||
] | ||
} |
@@ -283,6 +283,3 @@ # MessagePack for JavaScript/ECMA-262 | ||
// and later | ||
import { encode, decode } from "@msgpack/msgpack"; | ||
const encoded = = encode([new Set<any>(), new Map<any, any>()], { extensionCodec }); | ||
const encoded = encode([new Set<any>(), new Map<any, any>()], { extensionCodec }); | ||
const decoded = decode(encoded, { extensionCodec }); | ||
@@ -488,3 +485,3 @@ ``` | ||
NodeJS before v10 will work by importing `@msgpack/msgpack/dist.es5/msgpack`. | ||
NodeJS before v10 will work by importing `@msgpack/msgpack/dist.es5+umd/msgpack`. | ||
@@ -497,2 +494,4 @@ ### TypeScript | ||
We also recommend enabling `strict` mode (or `strictNullCheck` mode at least). Specifically when you use `ExtensionCodec` with the ContextType that you defines, the type checking for `EncodeOptions` argument of `encode` function and `DecodeOptions` arugument of `decode` function will fail because ts compiler cannot infer the `EncodeOptions`/`DecodeOptions` generic type appropriately unless `strictNullChecks` property is set to be `true` in `tsconfig.json`. | ||
## Benchmark | ||
@@ -529,5 +528,6 @@ | ||
* `dist/` is compiled into ES2015+ | ||
* `dist.es5/` is compiled into ES5 and bundled to singile file | ||
* `dist.es5/msgpack.min.js` - the default, minified file (UMD) | ||
* `dist.es5/msgpack.js` - an optional, non-minified file (UMD) | ||
* `dist.es5+umd/` is compiled into ES5 and bundled to singile file | ||
* `dist.es5+umd/msgpack.min.js` - the default, minified file (UMD) | ||
* `dist.es5+umd/msgpack.js` - an optional, non-minified file (UMD) | ||
* `dist.es5+esm/` is compiled into ES5 and placed as ES modules | ||
@@ -534,0 +534,0 @@ If you use NodeJS and/or webpack, their module resolvers use the suitable one automatically. |
// Main Functions: | ||
export { encode, EncodeOptions } from "./encode"; | ||
export { decode, DecodeOptions } from "./decode"; | ||
export { decodeAsync, decodeArrayStream, decodeStream } from "./decodeAsync"; | ||
import { encode } from "./encode"; | ||
export { encode }; | ||
import type { EncodeOptions } from "./encode"; | ||
export type { EncodeOptions }; | ||
/** | ||
* @experimental `Decoder` is exported for experimental use. | ||
*/ | ||
export { Decoder } from "./Decoder"; | ||
import { decode } from "./decode"; | ||
export { decode }; | ||
import type { DecodeOptions } from "./decode"; | ||
export { DecodeOptions }; | ||
/** | ||
* @experimental `Encoder` is exported for experimental use. | ||
*/ | ||
export { Encoder } from "./Encoder"; | ||
import { decodeAsync, decodeArrayStream, decodeStream } from "./decodeAsync"; | ||
export { decodeAsync, decodeArrayStream, decodeStream }; | ||
import { Decoder } from "./Decoder"; | ||
export { Decoder }; | ||
import { Encoder } from "./Encoder"; | ||
export { Encoder }; | ||
// Utilitiies for Extension Types: | ||
export { ExtensionCodec, ExtensionCodecType, ExtensionDecoderType, ExtensionEncoderType } from "./ExtensionCodec"; | ||
export { ExtData } from "./ExtData"; | ||
import { ExtensionCodec } from "./ExtensionCodec"; | ||
export { ExtensionCodec }; | ||
import type { ExtensionCodecType, ExtensionDecoderType, ExtensionEncoderType } from "./ExtensionCodec"; | ||
export type { ExtensionCodecType, ExtensionDecoderType, ExtensionEncoderType }; | ||
import { ExtData } from "./ExtData"; | ||
export { ExtData }; | ||
import { | ||
EXT_TIMESTAMP, | ||
encodeDateToTimeSpec, | ||
encodeTimeSpecToTimestamp, | ||
decodeTimestampToTimeSpec, | ||
encodeTimestampExtension, | ||
decodeTimestampExtension, | ||
} from "./timestamp"; | ||
export { | ||
@@ -28,2 +46,2 @@ EXT_TIMESTAMP, | ||
decodeTimestampExtension, | ||
} from "./timestamp"; | ||
}; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
618691
104
7240