For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/sdk/node/config/functions/ensureSchemaConfig.md.
  • 简体中文
  • Function: ensureSchemaConfig()

    function ensureSchemaConfig<T>(
       root: string, 
       name: ConfigName, 
       schemaId: ConfigSchemaId, 
       defaults: T, 
       from?: "configs" | "packs" | "modules"): T & {
      $schema?: string;
    };

    Defined in: node/config/index.ts:459

    ensure 带 $schema 的配置对象(DRY:禁止各服务手写 ensureJsonConfig+withConfigSchema)。 返回磁盘内容(可能含元数据键);运行时业务请用 loadEnsuredConfig。

    Type Parameters

    Type Parameter
    T extends Record<string, unknown>

    Parameters

    ParameterTypeDefault value
    rootstringundefined
    nameConfigNameundefined
    schemaIdConfigSchemaIdundefined
    defaultsTundefined
    from"configs" | "packs" | "modules""configs"

    Returns

    T & { $schema?: string; }