fix toml issue / isobject

This commit is contained in:
2026-02-17 01:19:43 -06:00
parent 400c58e5f2
commit 3c28dc2c30
5 changed files with 8 additions and 22 deletions

View File

@@ -1,15 +1,11 @@
var package = {}
var fd = use('fd')
var toml = use('toml')
var json = use('json')
var runtime = use('runtime')
var link = use('link')
var global_shop_path = runtime.shop_path
// Cache for loaded configs to avoid toml re-parsing corruption
var config_cache = {}
// Convert package name to a safe directory name
// For absolute paths (local packages), replace / with _
// For remote packages, keep slashes as they use nested directories
@@ -48,10 +44,6 @@ package.load_config = function(name)
{
var config_path = get_path(name) + '/cell.toml'
// Return cached config if available
if (config_cache[config_path])
return config_cache[config_path]
if (!fd.is_file(config_path)) {
print(`${config_path} does not exist`); disrupt
}
@@ -65,10 +57,6 @@ package.load_config = function(name)
return {}
}
// Deep copy to avoid toml module's shared state bug and cache it
result = json.decode(json.encode(result))
config_cache[config_path] = result
return result
}