diff --git a/src/persistence.ts b/src/persistence.ts index 78361f2..bf55a19 100644 --- a/src/persistence.ts +++ b/src/persistence.ts @@ -148,10 +148,7 @@ class DatasetPersistence { }); } - static assertConfigured(input: Config): asserts input is Config & { - hfDatasetRepoUrl: string; - hfPrivateSshKey: string; - } { + static assertConfigured(input: Config): asserts input is ConfigWithDatasets { if (!input.hfDatasetRepoUrl) { throw new Error("HF_DATASET_REPO_URL is required when using Datasets."); } @@ -162,4 +159,9 @@ class DatasetPersistence { } } +type ConfigWithDatasets = Config & { + hfDatasetRepoUrl: string; + hfPrivateSshKey: string; +}; + export { DatasetPersistence };