Skip to content

Commit 9fe3f65

Browse files
committed
refactor: enhance parameterIndex handling in getFlowValidation.ts for better safety checks
1 parent 2c7677b commit 9fe3f65

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/validation/getFlowValidation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const getFlowValidation = (
6363

6464
if (closestMatch) {
6565
nodeId = closestMatch[1] === "null" ? null : closestMatch[1] as NodeFunction['id'];
66-
parameterIndex = parseInt(closestMatch[2], 10) || null;
66+
parameterIndex = parseInt(closestMatch[2], 10);
6767
}
6868
}
6969

@@ -72,7 +72,7 @@ export const getFlowValidation = (
7272
code: d.code,
7373
severity: "error" as const,
7474
nodeId,
75-
parameterIndex
75+
parameterIndex: typeof parameterIndex == "number" && Number.isSafeInteger(parameterIndex) ? parameterIndex : null,
7676
};
7777
}).filter((e) => e !== null);
7878

0 commit comments

Comments
 (0)