@avanio/variable-util
    Preparing search index...

    Interface AbstractFileRecordLoaderOptions<FileType>

    Options for the AbstractFileRecordLoader.

    v1.0.0

    interface AbstractFileRecordLoaderOptions<FileType extends string> {
        disabled: boolean;
        fileName: string;
        fileType: FileType;
        isSilent: boolean;
        logger: ILoggerLike | undefined;
        validate:
            | ValidateCallback<
                Record<string, string | undefined>,
                Record<string, string | undefined>,
            >
            | undefined;
        watch: boolean;
    }

    Type Parameters

    • FileType extends string

      Type of the file

    Hierarchy

    • IConfigLoaderProps
      • AbstractFileRecordLoaderOptions
    Index

    Properties

    disabled: boolean

    set to true to disable loader

    fileName: string

    file name to load

    fileType: FileType
    isSilent: boolean

    set to false if need errors

    logger: ILoggerLike | undefined

    optional logger

    validate:
        | ValidateCallback<
            Record<string, string | undefined>,
            Record<string, string | undefined>,
        >
        | undefined

    optional validator for data (Record<string, string | undefined>)

    // using zod
    const stringRecordSchema = z.record(z.string().min(1), z.string());
    const validate: ValidateCallback<Record<string, string>> = async (data) => {
    const result = await stringRecordSchema.safeParseAsync(data);
    if (!result.success) {
    return {success: false, message: result.error.message};
    }
    return {success: true};
    };
    watch: boolean

    set to true to watch file for changes