2024-08-02 22:47:36 +08:00
|
|
|
import { system } from "$sb/syscalls.ts";
|
2022-07-15 17:17:02 +08:00
|
|
|
|
2022-07-18 16:51:28 +08:00
|
|
|
/**
|
2024-08-02 22:47:36 +08:00
|
|
|
* Retrieves a setting from the space configuration.
|
|
|
|
* @deprecated Use use `editor.getSpaceConfig` syscall instead
|
|
|
|
* @param key string
|
|
|
|
* @param defaultValue
|
|
|
|
* @returns
|
2022-07-18 16:51:28 +08:00
|
|
|
*/
|
2022-12-16 23:35:23 +08:00
|
|
|
export async function readSetting(
|
|
|
|
key: string,
|
|
|
|
defaultValue?: any,
|
|
|
|
): Promise<any> {
|
2024-08-02 22:47:36 +08:00
|
|
|
return await system.getSpaceConfig(key) ?? defaultValue;
|
2022-09-13 14:41:01 +08:00
|
|
|
}
|