From 33ffd2c9a9c94b5cf122e59742ddca3ec565a0e1 Mon Sep 17 00:00:00 2001 From: zykem#0643 <86602828+Zykem@users.noreply.github.com> Date: Sun, 6 Jul 2025 16:01:31 +0200 Subject: [PATCH 1/2] Add ESX.GetConfig optional parameter --- [core]/es_extended/shared/functions.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/[core]/es_extended/shared/functions.lua b/[core]/es_extended/shared/functions.lua index 8e326150..90223383 100644 --- a/[core]/es_extended/shared/functions.lua +++ b/[core]/es_extended/shared/functions.lua @@ -28,9 +28,10 @@ function ESX.GetRandomString(length) return length > 0 and ESX.GetRandomString(length - 1) .. Charset[math.random(1, #Charset)] or "" end ----@return table -function ESX.GetConfig() - return Config +---@param key? string Key pair to get specific value of config +---@return unknown: Returns the whole config if no key is passed, or a specific value +function ESX.GetConfig(key) + return key and Config[key] or Config end ---@param weaponName string From 2a2428d6e0731f10040943add8edc8360939d8fa Mon Sep 17 00:00:00 2001 From: zykem#0643 <86602828+Zykem@users.noreply.github.com> Date: Sun, 6 Jul 2025 16:21:01 +0200 Subject: [PATCH 2/2] Remove ':' from LDoc annotation --- [core]/es_extended/shared/functions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[core]/es_extended/shared/functions.lua b/[core]/es_extended/shared/functions.lua index 90223383..4b84d33c 100644 --- a/[core]/es_extended/shared/functions.lua +++ b/[core]/es_extended/shared/functions.lua @@ -29,7 +29,7 @@ function ESX.GetRandomString(length) end ---@param key? string Key pair to get specific value of config ----@return unknown: Returns the whole config if no key is passed, or a specific value +---@return unknown Returns the whole config if no key is passed, or a specific value function ESX.GetConfig(key) return key and Config[key] or Config end