mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-11 00:33:56 +00:00
fix(package/cache): check if cached value is defined
This commit is contained in:
1 parent
21214728b7
commit
4657de6470
1 file changed
+2
-2
+2
-2
@@ -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