Skip to content

Commit 52e3a71

Browse files
committed
Define order of JSON.stringify operation
1 parent cce5a98 commit 52e3a71

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

extensions/ql-vscode/src/model-editor/shared/validation.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ export function validateModeledMethods(
9898
const seenModeledMethods = new Set<string>();
9999
for (const modeledMethod of consideredModeledMethods) {
100100
const canonicalModeledMethod = canonicalizeModeledMethod(modeledMethod);
101-
const key = JSON.stringify(canonicalModeledMethod);
101+
const key = JSON.stringify(
102+
canonicalModeledMethod,
103+
// This ensures the keys are always in the same order
104+
Object.keys(canonicalModeledMethod).sort(),
105+
);
102106

103107
if (seenModeledMethods.has(key)) {
104108
result.push({

0 commit comments

Comments
 (0)