mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-08 00:29:39 +02:00
#945 Some cleanup
This commit is contained in:
16
src/diagrams/state/id-cache.js
Normal file
16
src/diagrams/state/id-cache.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const idCache = {};
|
||||
|
||||
export const set = (key, val) => {
|
||||
idCache[key] = val;
|
||||
};
|
||||
|
||||
export const get = k => idCache[k];
|
||||
export const keys = () => Object.keys(idCache);
|
||||
export const size = () => keys().length;
|
||||
|
||||
export default {
|
||||
get,
|
||||
set,
|
||||
keys,
|
||||
size
|
||||
};
|
Reference in New Issue
Block a user