mirror of
https://github.com/Snigdha-OS/documentation.git
synced 2025-09-09 19:44:56 +02:00
18 lines
375 B
JavaScript
18 lines
375 B
JavaScript
'use strict';
|
|
/**
|
|
* @param {string} value
|
|
* @param {(value: string, num: number) => string} encoder
|
|
* @param {Record<string, {ident: string, count: number}>} cache
|
|
* @return {void}
|
|
*/
|
|
module.exports = function (value, encoder, cache) {
|
|
if (cache[value]) {
|
|
return;
|
|
}
|
|
|
|
cache[value] = {
|
|
ident: encoder(value, Object.keys(cache).length),
|
|
count: 0,
|
|
};
|
|
};
|