mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-16 22:46:03 +01:00
fix(package/cache): check if cached value is defined
This commit is contained in:
4
package/shared/resource/cache/index.ts
vendored
4
package/shared/resource/cache/index.ts
vendored
@@ -5,13 +5,13 @@ export const cache: Record<string, any> = new Proxy(
|
||||
{
|
||||
get(target, key: string) {
|
||||
const result = key ? target[key] : target;
|
||||
if (result) return result;
|
||||
if (result !== undefined) return result;
|
||||
|
||||
AddEventHandler(`ox_lib:cache:${key}`, (value: any) => {
|
||||
target[key] = value;
|
||||
});
|
||||
|
||||
target[key] = exports.ox_lib.cache(key);
|
||||
target[key] = exports.ox_lib.cache(key) || false;
|
||||
return target[key];
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user