norn-cli 1.3.9 → 1.3.10

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to the "Norn" extension will be documented in this file.
4
4
 
5
+ ## [1.3.10] - 2026-02-09
6
+
7
+ ### Fixed
8
+ - **Type Preservation in Property Assignments**: Bare variables now preserve their original type
9
+ - `payload.userId = myNumericVar` keeps the number type instead of converting to string
10
+ - Script outputs that are valid JSON (numbers, booleans, objects) are now properly typed
11
+ - Use `payload.field = "{{var}}"` to force string type when needed
12
+
5
13
  ## [1.3.9] - 2026-02-09
6
14
 
7
15
  ### Added
package/dist/cli.js CHANGED
@@ -28072,12 +28072,36 @@ async function runSequenceWithJar(sequenceContent, fileVariables, cookieJar, wor
28072
28072
  duration: Date.now() - startTime
28073
28073
  };
28074
28074
  }
28075
- const bareResolvedValue = resolveBareVariables(parsed.value, runtimeVariables);
28076
- const resolvedValue = substituteVariables(bareResolvedValue, runtimeVariables);
28077
- let newValue = resolvedValue;
28078
- try {
28079
- newValue = JSON.parse(resolvedValue);
28080
- } catch {
28075
+ const valueTrimmed = parsed.value.trim();
28076
+ const bareVarMatch = valueTrimmed.match(/^([a-zA-Z_][a-zA-Z0-9_]*)((?:\.[a-zA-Z_][a-zA-Z0-9_]*|\[\d+\])*)$/);
28077
+ let newValue;
28078
+ if (bareVarMatch && bareVarMatch[1] in runtimeVariables) {
28079
+ const varName = bareVarMatch[1];
28080
+ const pathPart = bareVarMatch[2] || "";
28081
+ let value = runtimeVariables[varName];
28082
+ if (typeof value === "string") {
28083
+ try {
28084
+ const parsed2 = JSON.parse(value);
28085
+ if (typeof parsed2 === "object" && parsed2 !== null) {
28086
+ value = parsed2;
28087
+ }
28088
+ } catch {
28089
+ }
28090
+ }
28091
+ if (pathPart) {
28092
+ const path5 = pathPart.replace(/^\./, "");
28093
+ newValue = getNestedValueFromObject(value, path5);
28094
+ } else {
28095
+ newValue = value;
28096
+ }
28097
+ } else {
28098
+ const bareResolvedValue = resolveBareVariables(parsed.value, runtimeVariables);
28099
+ const resolvedValue = substituteVariables(bareResolvedValue, runtimeVariables);
28100
+ newValue = resolvedValue;
28101
+ try {
28102
+ newValue = JSON.parse(resolvedValue);
28103
+ } catch {
28104
+ }
28081
28105
  }
28082
28106
  const success = setNestedValue(jsonObj, parsed.propertyPath, newValue);
28083
28107
  if (!success) {
@@ -28314,9 +28338,7 @@ async function runSequenceWithJar(sequenceContent, fileVariables, cookieJar, wor
28314
28338
  let outputValue = result.output;
28315
28339
  try {
28316
28340
  const jsonParsed = JSON.parse(result.output);
28317
- if (typeof jsonParsed === "object" && jsonParsed !== null) {
28318
- outputValue = jsonParsed;
28319
- }
28341
+ outputValue = jsonParsed;
28320
28342
  } catch {
28321
28343
  }
28322
28344
  runtimeVariables[parsed.captureAs] = outputValue;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "norn-cli",
3
3
  "displayName": "Norn - REST Client",
4
4
  "description": "A powerful REST client for making HTTP requests with sequences, variables, scripts, and cookie support",
5
- "version": "1.3.9",
5
+ "version": "1.3.10",
6
6
  "publisher": "Norn-PeterKrustanov",
7
7
  "author": {
8
8
  "name": "Peter Krastanov"