Skip to content

Commit 25c1042

Browse files
committed
prevent overly friendly ids
1 parent ba68340 commit 25c1042

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/core/src/v3/isomorphic/friendlyId.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ export function toFriendlyId(entityName: string, internalId: string): string {
2121
throw new Error("Internal ID cannot be empty");
2222
}
2323

24+
if (internalId.startsWith(`${entityName}_`)) {
25+
return internalId;
26+
}
27+
2428
return `${entityName}_${internalId}`;
2529
}
2630

0 commit comments

Comments
 (0)