mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 04:55:42 +09:00
refactor(schema): simplify validation and OpenAPI generation (#2709)
This commit is contained in:
1 parent
4bc5593f9f
commit
de1fd95a99
510 files changed
+29494
-36131
No files matched your search
@@ -1,7 +1,8 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {type ConfigObject, isConfigObject} from '@fluxer/config/src/config_loader/ConfigObject';
|
||||
|
||||
type ConfigPathKey = string | number;
|
||||
type ConfigObject = Record<string, unknown>;
|
||||
type ConfigContainer = ConfigObject | Array<unknown>;
|
||||
|
||||
type EnvValueParser = (raw: string) => unknown;
|
||||
@@ -436,12 +437,8 @@ const NAMED_FLUXER_ENV_OVERRIDES: Record<string, NamedEnvOverride> = {
|
||||
FLUXER_GEOIP_DB_PATH: {path: ['geoip', 'maxmind_db_path']},
|
||||
};
|
||||
|
||||
function isPlainObject(value: unknown): value is ConfigObject {
|
||||
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
||||
}
|
||||
|
||||
function isContainer(value: unknown): value is ConfigContainer {
|
||||
return isPlainObject(value) || Array.isArray(value);
|
||||
return isConfigObject(value) || Array.isArray(value);
|
||||
}
|
||||
|
||||
function createChildContainer(nextKey: ConfigPathKey | undefined): ConfigContainer {
|
||||
|
||||
Reference in new issue
Block a user