Options
All
  • Public
  • Public/Protected
  • All
Menu

Package @tscmono/config

Index

References

JSONSchema

Re-exports JSONSchema

loadConfig

Re-exports loadConfig

Config Functions

Const getSubSchemas

  • getSubSchemas(schema: Partial<JSONSchema>, rootDir: string): { path: string; schema: JSONSchema }[]
  • Obtain a list of sub-schemas (referenced schemas) from a given schema

    Parameters

    • schema: Partial<JSONSchema>

      Schema to be parsed

    • rootDir: string

      Root directory to be used when resolving schema references

    Returns { path: string; schema: JSONSchema }[]

Const loadConfig

  • loadConfig<T>(schema: JSONSchema, name: string, rootDir?: undefined | string): Promise<T>
  • Uses cosmiconfig to obtain configuration and then match it against a JSON Schema to validate, and finally resolve the configuration

    Type parameters

    • T

    Parameters

    • schema: JSONSchema

      The JSON Schema to match config against

    • name: string

      The name of the config module name

    • Optional rootDir: undefined | string

      The directory used to find the monorepo root

    Returns Promise<T>

Const resolveRef

  • resolveRef(ref: string, rootDir: string): string
  • Resolve a schema reference to schema file

    Parameters

    • ref: string

      Reference to be resolved

    • rootDir: string

      Directory to be resolved against

    Returns string

Generated using TypeDoc