@uipath/maestro-builder-sdk 6.70.4 → 6.70.5

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/dist/decompile.js CHANGED
@@ -35,6 +35,7 @@ import { DEFAULT_TRIGGER_ID, Expr } from './core/expr.js';
35
35
  import { FLOW_NODE_TYPES } from './flow-node-registry.js';
36
36
  import { SUBFLOW_START_LABEL } from './core/subflow-start.js';
37
37
  import { commentText } from './core/comment-text.js';
38
+ import { escapeRegExp } from './core/escape-regexp.js';
38
39
  import { tsKey as key, tsLiteral, tsNumber, tsObject as objLit, tsOptions as opts, tsText } from './core/ts-literal.js';
39
40
  import { wireExprBody } from './core/wire-expr.js';
40
41
  import { hasExits } from './core/step-ports.js';
@@ -2864,7 +2865,7 @@ function emitChildFlow(name, childFile, ctx) {
2864
2865
  */
2865
2866
  function readChildStartAsStart(child, startId) {
2866
2867
  const renamed = renameVarRoot(child, startId, DEFAULT_TRIGGER_ID);
2867
- const path = new RegExp(`^(=?vars\\.)${startId.replace(/[$]/g, '\\$&')}(?![A-Za-z0-9_$])`);
2868
+ const path = new RegExp(`^(=?vars\\.)${escapeRegExp(startId)}(?![A-Za-z0-9_$])`);
2868
2869
  const walk = (x, key, parentKey) => {
2869
2870
  if (typeof x === 'string')
2870
2871
  return key === 'binding' || parentKey === 'appInputBindings' ? x.replace(path, `$1${DEFAULT_TRIGGER_ID}`) : x;
@@ -2954,8 +2955,9 @@ const RAW_JS_FIELDS = new Set(['script', 'expression', 'condition', 'completionC
2954
2955
  * script stays as written, the way `serialize` left it (#1092 review).
2955
2956
  */
2956
2957
  function renameVarRoot(v, from, to) {
2957
- const re = new RegExp(`\\$vars\\.${from.replace(/[$]/g, '\\$&')}(?![A-Za-z0-9_$])`, 'g');
2958
- const inCode = (js) => mapJsCode(js, (code) => code.replace(re, `$vars.${to}`));
2958
+ const re = new RegExp(`\\$vars\\.${escapeRegExp(from)}(?![A-Za-z0-9_$])`, 'g');
2959
+ // a function: `$&` in `to` is data
2960
+ const inCode = (js) => mapJsCode(js, (code) => code.replace(re, () => `$vars.${to}`));
2959
2961
  const walk = (x, key) => {
2960
2962
  if (typeof x === 'string') {
2961
2963
  if (x.startsWith('=js:'))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.70.4",
3
+ "version": "6.70.5",
4
4
  "description": "Build UiPath Flow, Case, and BPMN artifacts by writing TypeScript.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://docs.uipath.com/maestro",
@@ -100,5 +100,5 @@
100
100
  "@types/node": "^22.7.0",
101
101
  "esbuild": "^0.28.1"
102
102
  },
103
- "gitref": "e9ad3d42f515a19663813c7befb4f6afdea2b87c"
103
+ "gitref": "fa9dc7bf7b81b8dfd7fe6090beb21100879d79f6"
104
104
  }