From a4431ae35266b0f00035f108d8904ad9f928daa5 Mon Sep 17 00:00:00 2001 From: hoonoh Date: Mon, 7 Dec 2020 18:29:21 +0900 Subject: [PATCH] fix: set default limit if unset --- src/lib/core.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib/core.ts b/src/lib/core.ts index 72c1b5e7..3361f322 100644 --- a/src/lib/core.ts +++ b/src/lib/core.ts @@ -265,18 +265,17 @@ export const getGlobalSpotPrices = async (options?: { minVCPU, minMemoryGiB, platforms, - limit, reduceAZ, accessKeyId, secretAccessKey, onRegionFetch, onRegionFetchFail, onFetchComplete, - } = options || { - limit: defaults.limit, - }; + } = options || {}; + + let { limit, regions, instanceTypes } = options || {}; - let { regions, instanceTypes } = options || {}; + if (limit === undefined) limit = defaults.limit; if (regions === undefined || !regions.length) regions = defaultRegions;