mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-13 02:59:36 +02:00
fix(er): switch to deterministic uuids in ER
The entity relation diagram uses uuid v4, which is randomly generated. uuid v5 uses a SHA-1 hash, which makes the uuid deterministic. The input strings are unique for each diagram, so this should be okay.
This commit is contained in:
12
packages/mermaid/src/diagrams/er/erRenderer.spec.ts
Normal file
12
packages/mermaid/src/diagrams/er/erRenderer.spec.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { generateId } from './erRenderer';
|
||||
|
||||
describe('erRenderer', () => {
|
||||
describe('generateId', () => {
|
||||
it('should be deterministic', () => {
|
||||
const id1 = generateId('hello world', 'my-prefix');
|
||||
const id2 = generateId('hello world', 'my-prefix');
|
||||
|
||||
expect(id1).toBe(id2);
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user