From bf13a8b5240a0d6733438231b16eeae9c3b049c1 Mon Sep 17 00:00:00 2001 From: nai-degen Date: Mon, 28 Aug 2023 03:52:04 -0500 Subject: [PATCH] tweaks type --- src/persistence.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 };