@contrail/util 2.2.0-alpha.6ba8ba9 → 2.2.0-alpha.9e813d7

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.
@@ -7,7 +7,6 @@ exports.getJsonByteLength = getJsonByteLength;
7
7
  exports.exceedsResponseBudget = exceedsResponseBudget;
8
8
  exports.LAMBDA_MAX_RESPONSE_BYTES = 6 * 1024 * 1024;
9
9
  exports.DEFAULT_RESPONSE_BUFFER_BYTES = 0.5 * 1024 * 1024;
10
- const JSON_NULL_BYTES = 'null'.length;
11
10
  function getResponseBudgetBytes(options = {}) {
12
11
  var _a, _b;
13
12
  const maxBytes = (_a = options.maxBytes) !== null && _a !== void 0 ? _a : exports.LAMBDA_MAX_RESPONSE_BYTES;
@@ -41,7 +40,7 @@ function exceedsResponseBudget(value, options = {}) {
41
40
  return true;
42
41
  }
43
42
  const serialized = JSON.stringify(element);
44
- totalBytes += serialized === undefined ? JSON_NULL_BYTES : getUtf8ByteLength(serialized);
43
+ totalBytes += serialized === undefined ? 4 : getUtf8ByteLength(serialized);
45
44
  }
46
45
  return totalBytes > budgetBytes;
47
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/util",
3
- "version": "2.2.0-alpha.6ba8ba9",
3
+ "version": "2.2.0-alpha.9e813d7",
4
4
  "description": "General JavaScript utilities",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",