Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common Exporting common util #865

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/common/src/Adaptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};

Expand Down
4 changes: 2 additions & 2 deletions packages/common/src/http.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expandReferences } from './util';
import { expandReferences } from './util/references';
import { request } from './util/http';
import set from 'lodash/set';

Expand Down Expand Up @@ -44,7 +44,7 @@ const helpers = {
* @function
* @public
* @example <caption>Get with a query an oath token</caption>
* 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) {
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
File renamed without changes.
1 change: 0 additions & 1 deletion packages/common/src/util/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './http';
export * from './helpers';
export * from './references';
import parseDate from './parse-date';
import throwError from './throw-error';
Expand Down
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down
Loading