@mablhq/mabl-cli 2.129.24 → 2.129.26

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": "@mablhq/mabl-cli",
3
- "version": "2.129.24",
3
+ "version": "2.129.26",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "The official mabl command line interface tool",
6
6
  "main": "index.js",
@@ -7,7 +7,6 @@ const stepSerialization_1 = require("../sharedUtils/mablscript/stepSerialization
7
7
  const variableCanonical_1 = require("@mablhq/test-model/variableCanonical");
8
8
  const editing_1 = require("@mablhq/test-model/editing");
9
9
  const validator_1 = require("@mablhq/test-model/validator");
10
- const encodeInlineSnippetBodies_1 = require("./encodeInlineSnippetBodies");
11
10
  const sessionFlowResolution_1 = require("../sharedUtils/sessionFlowResolution");
12
11
  function serializeStepsToJson(steps, variables) {
13
12
  const aliasedVariables = (0, variableCanonical_1.aliasVariables)(variables);
@@ -30,7 +29,7 @@ function applyStepEditsToSteps(input) {
30
29
  const { steps, variables, snippetsByInvariantId, capturedSelectors, allowAuthoredFinds, editOps, } = input;
31
30
  const currentJson = serializeStepsToJson(steps, variables);
32
31
  const normalizedOps = allowAuthoredFinds
33
- ? (0, encodeInlineSnippetBodies_1.encodeInlineSnippetBodies)((0, editing_1.normalizeElementFinds)((0, editing_1.normalizeStepTypeKeys)(editOps)))
32
+ ? (0, editing_1.encodeInlineSnippetBodies)((0, editing_1.normalizeElementFinds)((0, editing_1.normalizeStepTypeKeys)(editOps)))
34
33
  : editOps;
35
34
  const presenceCleanup = allowAuthoredFinds
36
35
  ? (0, editing_1.stripInertPresenceAttribute)(normalizedOps)
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.encodeInlineSnippetBodies = encodeInlineSnippetBodies;
4
- const encodingUtil_1 = require("../../util/encodingUtil");
5
- const BASE64_ONLY = /^[A-Za-z0-9+/\s]+={0,2}$/;
6
- function isRawSource(body) {
7
- return body.trim().length > 0 && !BASE64_ONLY.test(body);
8
- }
9
- function encodeBodiesDeep(value) {
10
- if (Array.isArray(value)) {
11
- return value.map(encodeBodiesDeep);
12
- }
13
- if (value && typeof value === 'object') {
14
- const out = {};
15
- for (const [key, val] of Object.entries(value)) {
16
- const recursed = encodeBodiesDeep(val);
17
- if (key === 'inlineSnippet' &&
18
- recursed &&
19
- typeof recursed === 'object' &&
20
- typeof recursed.body === 'string' &&
21
- isRawSource(recursed.body)) {
22
- const snippet = recursed;
23
- out[key] = {
24
- ...snippet,
25
- body: (0, encodingUtil_1.b64EncodeUnicodeInNode)(snippet.body),
26
- };
27
- }
28
- else {
29
- out[key] = recursed;
30
- }
31
- }
32
- return out;
33
- }
34
- return value;
35
- }
36
- function encodeInlineSnippetBodies(ops) {
37
- return ops.map((op) => {
38
- const step = op.step;
39
- if (step === undefined) {
40
- return op;
41
- }
42
- return { ...op, step: encodeBodiesDeep(step) };
43
- });
44
- }