From afdf650ff252e6a86c82f2d223d6a88492da2d97 Mon Sep 17 00:00:00 2001 From: Emmanuel Evance Date: Wed, 11 Dec 2024 17:17:14 +0300 Subject: [PATCH] wip: fixing util export --- packages/common/src/Adaptor.js | 5 ++++- packages/common/src/http.js | 4 ++-- packages/common/src/index.js | 1 + packages/common/src/{util/helpers.js => util.js} | 0 packages/common/src/util/index.js | 1 - packages/common/test/util/{helpers.test.js => index.test.js} | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) rename packages/common/src/{util/helpers.js => util.js} (100%) rename packages/common/test/util/{helpers.test.js => index.test.js} (96%) diff --git a/packages/common/src/Adaptor.js b/packages/common/src/Adaptor.js index 7efcba0c3..133c63157 100644 --- a/packages/common/src/Adaptor.js +++ b/packages/common/src/Adaptor.js @@ -11,7 +11,10 @@ import { Readable } from 'node:stream'; import { request } from 'undici'; import dateFns from 'date-fns'; -import { expandReferences as newExpandReferences, parseDate } from './util'; +import { + expandReferences as newExpandReferences, + parseDate, +} from './util/index.js'; const schemaCache = {}; diff --git a/packages/common/src/http.js b/packages/common/src/http.js index a70bcf2a7..afef1b7ea 100644 --- a/packages/common/src/http.js +++ b/packages/common/src/http.js @@ -1,4 +1,4 @@ -import { expandReferences } from './util'; +import { expandReferences } from './util/references'; import { request } from './util/http'; import set from 'lodash/set'; @@ -44,7 +44,7 @@ const helpers = { * @function * @public * @example Get with a query an oath token - * get($.data.url, http.options({ query: $.query }).oath($.configuration.access_token) + * get($.data.url, http.options({ query: $.query }).oath($.configuration.access_token)) */ export function options(opts = {}) { for (let h in helpers) { diff --git a/packages/common/src/index.js b/packages/common/src/index.js index a67f6043e..ef497e134 100644 --- a/packages/common/src/index.js +++ b/packages/common/src/index.js @@ -5,4 +5,5 @@ export * from './Adaptor'; export * as beta from './beta'; export * as http from './http'; +export * as util from './util'; export * as dateFns from './dateFns'; diff --git a/packages/common/src/util/helpers.js b/packages/common/src/util.js similarity index 100% rename from packages/common/src/util/helpers.js rename to packages/common/src/util.js diff --git a/packages/common/src/util/index.js b/packages/common/src/util/index.js index c7fba722f..3bab65022 100644 --- a/packages/common/src/util/index.js +++ b/packages/common/src/util/index.js @@ -1,5 +1,4 @@ export * from './http'; -export * from './helpers'; export * from './references'; import parseDate from './parse-date'; import throwError from './throw-error'; diff --git a/packages/common/test/util/helpers.test.js b/packages/common/test/util/index.test.js similarity index 96% rename from packages/common/test/util/helpers.test.js rename to packages/common/test/util/index.test.js index ac6eb8997..eb7f91ddc 100644 --- a/packages/common/test/util/helpers.test.js +++ b/packages/common/test/util/index.test.js @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { encode, decode, uuid } from '../../src/util/helpers.js'; +import { encode, decode, uuid } from '../../src/util'; describe('uuid', () => { it('should generate a uuid', () => {