From 38905d8a817c5914ede389f5016611a3bce5eafc Mon Sep 17 00:00:00 2001 From: Vincent Germain Date: Tue, 26 Jul 2022 14:32:40 +0200 Subject: [PATCH] chore: export helper isJSONObject (#27) --- packages/clients/src/helpers/json.ts | 5 +++++ packages/clients/src/internals.ts | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/clients/src/helpers/json.ts b/packages/clients/src/helpers/json.ts index cdd50fffb..4cc06af08 100644 --- a/packages/clients/src/helpers/json.ts +++ b/packages/clients/src/helpers/json.ts @@ -22,6 +22,11 @@ export const isJSON = (obj: unknown): obj is JSON => { ) } +/** + * Validates an unknown object is a JSON Object. + * + * @internal + */ export const isJSONObject = (obj: unknown): obj is JSONObject => { const objT: string = typeof obj diff --git a/packages/clients/src/internals.ts b/packages/clients/src/internals.ts index 963d19fe9..033e33bed 100644 --- a/packages/clients/src/internals.ts +++ b/packages/clients/src/internals.ts @@ -1,10 +1,10 @@ -export { API } from './scw/api' +export { isJSONObject } from './helpers/json' export { waitForResource } from './internal/async/interval-retrier' -export { authenticateWithSessionToken } from './scw/auth' export type { RequestInterceptor } from './internal/interceptors/request' export type { ResponseInterceptor } from './internal/interceptors/response' +export { API } from './scw/api' +export { authenticateWithSessionToken } from './scw/auth' export type { DefaultValues } from './scw/client-ini-profile' -export type { ServiceInfo } from './scw/custom-types' export { marshalScwFile, marshalMoney, @@ -15,6 +15,7 @@ export { unmarshalTimeSeries, unmarshalTimeSeriesPoint, } from './scw/custom-marshalling' +export type { ServiceInfo } from './scw/custom-types' export { resolveOneOf, unmarshalDate,