mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-21 06:53:17 +08:00
17 lines
260 B
JavaScript
17 lines
260 B
JavaScript
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,
|
|
};
|