;(globalThis as any).cacheMemoria_cache = _cache

This commit is contained in:
Luiz Silva 2025-09-06 06:22:20 -03:00
parent 6dd0569f9e
commit 5ed3207ecf
4 changed files with 5 additions and 2 deletions

View file

@ -25,6 +25,7 @@ __export(cacheMemoria_exports, {
}); });
module.exports = __toCommonJS(cacheMemoria_exports); module.exports = __toCommonJS(cacheMemoria_exports);
const _cache = {}; const _cache = {};
globalThis.cacheMemoria_cache = _cache;
const cacheM = (chave, valor, validadeSeg) => { const cacheM = (chave, valor, validadeSeg) => {
const txChave = typeof chave == "string" ? chave : typeof chave == "number" ? String(chave) : encodeURIComponent(JSON.stringify(chave)); const txChave = typeof chave == "string" ? chave : typeof chave == "number" ? String(chave) : encodeURIComponent(JSON.stringify(chave));
const validade = validadeSeg && (/* @__PURE__ */ new Date()).getTime() + validadeSeg * 1e3; const validade = validadeSeg && (/* @__PURE__ */ new Date()).getTime() + validadeSeg * 1e3;

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{ {
"name": "p-comuns", "name": "p-comuns",
"version": "0.221.0", "version": "0.222.0",
"description": "", "description": "",
"main": "./dist-back/index.js", "main": "./dist-back/index.js",
"module": "./dist-front/index.mjs", "module": "./dist-front/index.mjs",

View file

@ -10,6 +10,8 @@ const _cache: {
| undefined | undefined
} = {} } = {}
;(globalThis as any).cacheMemoria_cache = _cache
export const cacheM = <T>( export const cacheM = <T>(
chave: any, chave: any,
valor?: T, valor?: T,