From cb9eaac096fcfd5e673295de9aed798d43991bc1 Mon Sep 17 00:00:00 2001 From: Charlie Andrews Date: Wed, 10 May 2023 11:12:58 -0700 Subject: [PATCH 1/3] fix(types): dont destructure argv in yargs check --- src/config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.ts b/src/config.ts index fb343a87..35d40d26 100644 --- a/src/config.ts +++ b/src/config.ts @@ -71,8 +71,8 @@ export const config = yargs example: 'personalDataAndDocumentsNigeria', choices: Object.keys(MOCK_KYC), }) - .check(({ quoteInMock, quoteOutMock }) => { - if (!quoteOutMock && !quoteInMock) { + .check((argv) => { + if (!argv.quoteOutMock && !argv.quoteInMock) { throw new Error( 'Must specify at least one of quote-in-mock or quote-out-mock', ) From 169ecc2381b6f09b004154b8676f37a8781b6316 Mon Sep 17 00:00:00 2001 From: Charlie Andrews Date: Wed, 10 May 2023 11:32:44 -0700 Subject: [PATCH 2/3] destructure but avoid camelCasing magic --- src/config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.ts b/src/config.ts index 35d40d26..71c922c4 100644 --- a/src/config.ts +++ b/src/config.ts @@ -71,8 +71,8 @@ export const config = yargs example: 'personalDataAndDocumentsNigeria', choices: Object.keys(MOCK_KYC), }) - .check((argv) => { - if (!argv.quoteOutMock && !argv.quoteInMock) { + .check(({'quote-in-mock': quoteInMock, 'quote-out-mock': quoteOutMock}) => { + if (!quoteOutMock && !quoteInMock) { throw new Error( 'Must specify at least one of quote-in-mock or quote-out-mock', ) From 837376a44d27ab009c9e8bef89588ba6a854f06a Mon Sep 17 00:00:00 2001 From: Charlie Andrews Date: Wed, 10 May 2023 11:38:01 -0700 Subject: [PATCH 3/3] format --- src/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index 71c922c4..8b3b95c2 100644 --- a/src/config.ts +++ b/src/config.ts @@ -71,7 +71,7 @@ export const config = yargs example: 'personalDataAndDocumentsNigeria', choices: Object.keys(MOCK_KYC), }) - .check(({'quote-in-mock': quoteInMock, 'quote-out-mock': quoteOutMock}) => { + .check(({ 'quote-in-mock': quoteInMock, 'quote-out-mock': quoteOutMock }) => { if (!quoteOutMock && !quoteInMock) { throw new Error( 'Must specify at least one of quote-in-mock or quote-out-mock',