@jsii/runtime 1.88.0 → 1.89.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsii/runtime",
3
- "version": "1.88.0",
3
+ "version": "1.89.0",
4
4
  "description": "jsii runtime kernel process",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -34,14 +34,14 @@
34
34
  "package": "package-js"
35
35
  },
36
36
  "dependencies": {
37
- "@jsii/kernel": "^1.88.0",
38
- "@jsii/check-node": "1.88.0",
39
- "@jsii/spec": "^1.88.0"
37
+ "@jsii/kernel": "^1.89.0",
38
+ "@jsii/check-node": "1.89.0",
39
+ "@jsii/spec": "^1.89.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@scope/jsii-calc-base": "^1.88.0",
43
- "@scope/jsii-calc-lib": "^1.88.0",
44
- "jsii-build-tools": "^1.88.0",
42
+ "@scope/jsii-calc-base": "^1.89.0",
43
+ "@scope/jsii-calc-lib": "^1.89.0",
44
+ "jsii-build-tools": "^1.89.0",
45
45
  "jsii-calc": "^3.20.120",
46
46
  "source-map-loader": "^4.0.1",
47
47
  "webpack": "^5.88.2",
@@ -4940,14 +4940,25 @@ var __webpack_modules__ = {
4940
4940
  }
4941
4941
  this.portable = !!opt.portable;
4942
4942
  this.zip = null;
4943
- if (opt.gzip) {
4944
- if (typeof opt.gzip !== "object") {
4945
- opt.gzip = {};
4943
+ if (opt.gzip || opt.brotli) {
4944
+ if (opt.gzip && opt.brotli) {
4945
+ throw new TypeError("gzip and brotli are mutually exclusive");
4946
4946
  }
4947
- if (this.portable) {
4948
- opt.gzip.portable = true;
4947
+ if (opt.gzip) {
4948
+ if (typeof opt.gzip !== "object") {
4949
+ opt.gzip = {};
4950
+ }
4951
+ if (this.portable) {
4952
+ opt.gzip.portable = true;
4953
+ }
4954
+ this.zip = new zlib.Gzip(opt.gzip);
4955
+ }
4956
+ if (opt.brotli) {
4957
+ if (typeof opt.brotli !== "object") {
4958
+ opt.brotli = {};
4959
+ }
4960
+ this.zip = new zlib.BrotliCompress(opt.brotli);
4949
4961
  }
4950
- this.zip = new zlib.Gzip(opt.gzip);
4951
4962
  this.zip.on("data", (chunk => super.write(chunk)));
4952
4963
  this.zip.on("end", (_ => super.end()));
4953
4964
  this.zip.on("drain", (_ => this[ONDRAIN]()));
@@ -5288,6 +5299,8 @@ var __webpack_modules__ = {
5288
5299
  this.strict = !!opt.strict;
5289
5300
  this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize;
5290
5301
  this.filter = typeof opt.filter === "function" ? opt.filter : noop;
5302
+ const isTBR = opt.file && (opt.file.endsWith(".tar.br") || opt.file.endsWith(".tbr"));
5303
+ this.brotli = !opt.gzip && opt.brotli !== undefined ? opt.brotli : isTBR ? undefined : false;
5291
5304
  this.writable = true;
5292
5305
  this.readable = false;
5293
5306
  this[QUEUE] = new Yallist;
@@ -5502,7 +5515,8 @@ var __webpack_modules__ = {
5502
5515
  if (this[ABORTED]) {
5503
5516
  return;
5504
5517
  }
5505
- if (this[UNZIP] === null && chunk) {
5518
+ const needSniff = this[UNZIP] === null || this.brotli === undefined && this[UNZIP] === false;
5519
+ if (needSniff && chunk) {
5506
5520
  if (this[BUFFER]) {
5507
5521
  chunk = Buffer.concat([ this[BUFFER], chunk ]);
5508
5522
  this[BUFFER] = null;
@@ -5516,10 +5530,28 @@ var __webpack_modules__ = {
5516
5530
  this[UNZIP] = false;
5517
5531
  }
5518
5532
  }
5519
- if (this[UNZIP] === null) {
5533
+ const maybeBrotli = this.brotli === undefined;
5534
+ if (this[UNZIP] === false && maybeBrotli) {
5535
+ if (chunk.length < 512) {
5536
+ if (this[ENDED]) {
5537
+ this.brotli = true;
5538
+ } else {
5539
+ this[BUFFER] = chunk;
5540
+ return true;
5541
+ }
5542
+ } else {
5543
+ try {
5544
+ new Header(chunk.slice(0, 512));
5545
+ this.brotli = false;
5546
+ } catch (_) {
5547
+ this.brotli = true;
5548
+ }
5549
+ }
5550
+ }
5551
+ if (this[UNZIP] === null || this[UNZIP] === false && this.brotli) {
5520
5552
  const ended = this[ENDED];
5521
5553
  this[ENDED] = false;
5522
- this[UNZIP] = new zlib.Unzip;
5554
+ this[UNZIP] = this[UNZIP] === null ? new zlib.Unzip : new zlib.BrotliDecompress;
5523
5555
  this[UNZIP].on("data", (chunk => this[CONSUMECHUNK](chunk)));
5524
5556
  this[UNZIP].on("error", (er => this.abort(er)));
5525
5557
  this[UNZIP].on("end", (_ => {
@@ -5631,6 +5663,7 @@ var __webpack_modules__ = {
5631
5663
  this[UNZIP].end(chunk);
5632
5664
  } else {
5633
5665
  this[ENDED] = true;
5666
+ if (this.brotli === undefined) chunk = chunk || Buffer.alloc(0);
5634
5667
  this.write(chunk);
5635
5668
  }
5636
5669
  }
@@ -5949,7 +5982,7 @@ var __webpack_modules__ = {
5949
5982
  if (!opt.file) {
5950
5983
  throw new TypeError("file is required");
5951
5984
  }
5952
- if (opt.gzip) {
5985
+ if (opt.gzip || opt.brotli || opt.file.endsWith(".br") || opt.file.endsWith(".tbr")) {
5953
5986
  throw new TypeError("cannot append to compressed archives");
5954
5987
  }
5955
5988
  if (!files || !Array.isArray(files) || !files.length) {
@@ -6840,7 +6873,7 @@ var __webpack_modules__ = {
6840
6873
  if (!opt.file) {
6841
6874
  throw new TypeError("file is required");
6842
6875
  }
6843
- if (opt.gzip) {
6876
+ if (opt.gzip || opt.brotli || opt.file.endsWith(".br") || opt.file.endsWith(".tbr")) {
6844
6877
  throw new TypeError("cannot append to compressed archives");
6845
6878
  }
6846
6879
  if (!files || !Array.isArray(files) || !files.length) {
@@ -17426,7 +17459,7 @@ var __webpack_modules__ = {
17426
17459
  },
17427
17460
  4147: module => {
17428
17461
  "use strict";
17429
- module.exports = JSON.parse('{"name":"@jsii/runtime","version":"1.88.0","description":"jsii runtime kernel process","license":"Apache-2.0","author":{"name":"Amazon Web Services","url":"https://aws.amazon.com"},"homepage":"https://github.com/aws/jsii","bugs":{"url":"https://github.com/aws/jsii/issues"},"repository":{"type":"git","url":"https://github.com/aws/jsii.git","directory":"packages/@jsii/runtime"},"engines":{"node":">= 14.17.0"},"main":"lib/index.js","types":"lib/index.d.ts","bin":{"jsii-runtime":"bin/jsii-runtime"},"scripts":{"build":"tsc --build && chmod +x bin/jsii-runtime && npx webpack-cli && npm run lint","watch":"tsc --build -w","lint":"eslint . --ext .js,.ts --ignore-path=.gitignore --ignore-pattern=webpack.config.js","lint:fix":"yarn lint --fix","test":"jest","test:update":"jest -u","package":"package-js"},"dependencies":{"@jsii/kernel":"^1.88.0","@jsii/check-node":"1.88.0","@jsii/spec":"^1.88.0"},"devDependencies":{"@scope/jsii-calc-base":"^1.88.0","@scope/jsii-calc-lib":"^1.88.0","jsii-build-tools":"^1.88.0","jsii-calc":"^3.20.120","source-map-loader":"^4.0.1","webpack":"^5.88.2","webpack-cli":"^5.1.4"}}');
17462
+ module.exports = JSON.parse('{"name":"@jsii/runtime","version":"1.89.0","description":"jsii runtime kernel process","license":"Apache-2.0","author":{"name":"Amazon Web Services","url":"https://aws.amazon.com"},"homepage":"https://github.com/aws/jsii","bugs":{"url":"https://github.com/aws/jsii/issues"},"repository":{"type":"git","url":"https://github.com/aws/jsii.git","directory":"packages/@jsii/runtime"},"engines":{"node":">= 14.17.0"},"main":"lib/index.js","types":"lib/index.d.ts","bin":{"jsii-runtime":"bin/jsii-runtime"},"scripts":{"build":"tsc --build && chmod +x bin/jsii-runtime && npx webpack-cli && npm run lint","watch":"tsc --build -w","lint":"eslint . --ext .js,.ts --ignore-path=.gitignore --ignore-pattern=webpack.config.js","lint:fix":"yarn lint --fix","test":"jest","test:update":"jest -u","package":"package-js"},"dependencies":{"@jsii/kernel":"^1.89.0","@jsii/check-node":"1.89.0","@jsii/spec":"^1.89.0"},"devDependencies":{"@scope/jsii-calc-base":"^1.89.0","@scope/jsii-calc-lib":"^1.89.0","jsii-build-tools":"^1.89.0","jsii-calc":"^3.20.120","source-map-loader":"^4.0.1","webpack":"^5.88.2","webpack-cli":"^5.1.4"}}');
17430
17463
  },
17431
17464
  5277: module => {
17432
17465
  "use strict";