From ac18443b535c166c266028a640605cef5700fb0e Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Thu, 6 Feb 2025 08:37:09 +0100 Subject: [PATCH] Support setting multiple keys in config --- plugs/core/Library/Std/Config.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugs/core/Library/Std/Config.md b/plugs/core/Library/Std/Config.md index 96e11f7c..d551ddb7 100644 --- a/plugs/core/Library/Std/Config.md +++ b/plugs/core/Library/Std/Config.md @@ -13,7 +13,14 @@ function config.define(key, schema) config_schema[key] = schema or true end -function config.set(key, value) +function config.set(keyOrTable, value) + if type(keyOrTable) == "table" then + for key, value in pairs(keyOrTable) do + config.set(key, value) + end + return + end + local key = keyOrTable local schema = config_schema[key] if schema == nil then error("Config key not defined: " .. key)