@mablhq/mabl-cli 2.34.12 → 2.37.7

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.
@@ -3,10 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.decodeTestConfigAsParamsForParsedUrlProtocol = exports.encodeTestConfigAsParamsForParsedUrlProtocol = exports.b64EncodeUnicodeInNode = exports.b64DecodeUnicodeInNode = exports.TEST_CONFIG_URL_PARAM_KEY = void 0;
6
+ exports.decodeTestConfigAsParamsForParsedUrlProtocol = exports.encodeTestConfigAsParamsForParsedUrlProtocol = exports.b64DecodeUnicodeNodeOrBrowser = exports.b64EncodeUnicodeInNode = exports.b64DecodeUnicodeInNode = exports.isNode = exports.TEST_CONFIG_URL_PARAM_KEY = void 0;
7
7
  const querystring_1 = __importDefault(require("querystring"));
8
+ const domUtil_1 = require("../domUtil");
8
9
  const MAX_PARSED_URL_PROTOCOL_PARAMS_LENGTH = 2000;
9
10
  exports.TEST_CONFIG_URL_PARAM_KEY = 'scriptConfig';
11
+ function isNode() {
12
+ var _a;
13
+ return !!((_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node);
14
+ }
15
+ exports.isNode = isNode;
10
16
  function b64DecodeUnicodeInNode(encoded) {
11
17
  return Buffer.from(encoded, 'base64').toString();
12
18
  }
@@ -15,6 +21,13 @@ function b64EncodeUnicodeInNode(text) {
15
21
  return Buffer.from(text).toString('base64');
16
22
  }
17
23
  exports.b64EncodeUnicodeInNode = b64EncodeUnicodeInNode;
24
+ function b64DecodeUnicodeNodeOrBrowser(encoded) {
25
+ if (isNode()) {
26
+ return b64DecodeUnicodeInNode(encoded);
27
+ }
28
+ return (0, domUtil_1.b64DecodeUnicode)(encoded);
29
+ }
30
+ exports.b64DecodeUnicodeNodeOrBrowser = b64DecodeUnicodeNodeOrBrowser;
18
31
  function encodeTestConfigAsParamsForParsedUrlProtocol(testConfig, b64Encode) {
19
32
  const encoded = querystring_1.default.stringify({
20
33
  ...testConfig,