@dev-blinq/cucumber_client 1.0.1726-dev → 1.0.1728-dev

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.
@@ -691,7 +691,7 @@ const _generateCodeFromCommand = (step, elements, userData) => {
691
691
  if (step.dataSource === "userData" || step.dataSource === "parameters") {
692
692
  input = "_" + step.dataKey;
693
693
  }
694
- // options = options ?? {};
694
+ options = options ?? {};
695
695
  // options.context = input;
696
696
  line = `await context.web.click(elements["${elementIdentifier}"], _params, ${serializeOptions(options, input)}, this);`;
697
697
  codeLines.push(line);
@@ -716,7 +716,7 @@ const _generateCodeFromCommand = (step, elements, userData) => {
716
716
  if (step.dataSource === "userData" || step.dataSource === "parameters") {
717
717
  input = "_" + step.dataKey;
718
718
  }
719
- // options = options ?? {};
719
+ options = options ?? {};
720
720
  // options.context = input;
721
721
  line = `await context.web.click(elements["${elementIdentifier}"], _params, ${serializeOptions(options, input)}, this);`;
722
722
  codeLines.push(line);
@@ -1,8 +1,14 @@
1
1
  import { promises as fs } from "node:fs";
2
2
  import path from "node:path";
3
3
  import { parse } from "@babel/parser";
4
- import traverse from "@babel/traverse";
4
+ import traverseImport from "@babel/traverse";
5
5
  import * as t from "@babel/types";
6
+ // @babel/traverse may export the visitor function either as the module itself (CJS)
7
+ // or under a `default` property (ESM). Normalize to a callable function to avoid
8
+ // runtime "traverse is not a function" errors in bundled environments.
9
+ const traverse = typeof traverseImport === "function"
10
+ ? traverseImport
11
+ : (traverseImport.default ?? traverseImport);
6
12
  const IGNORE_DIRS = new Set(["node_modules", ".git", ".idea"]);
7
13
  function propName(prop) {
8
14
  if (!t.isObjectProperty(prop))
@@ -1,8 +1,12 @@
1
1
  import { promises as fs } from "node:fs";
2
2
  import path from "node:path";
3
3
  import { parse } from "@babel/parser";
4
- import traverse from "@babel/traverse";
4
+ import traverseImport from "@babel/traverse";
5
5
  import * as t from "@babel/types";
6
+ // Normalize babel traverse to handle both CJS (callable export) and ESM (default export)
7
+ const traverse = typeof traverseImport === "function"
8
+ ? traverseImport
9
+ : (traverseImport.default ?? traverseImport);
6
10
  function isNumericKey(key) {
7
11
  return typeof key === "string" && /^\d+$/.test(key);
8
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-blinq/cucumber_client",
3
- "version": "1.0.1726-dev",
3
+ "version": "1.0.1728-dev",
4
4
  "description": " ",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",