Skip to content

Commit

Permalink
chore: fix ApiBeacon to support esm build (#1604)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpanot authored Apr 8, 2024
2 parents 10ec3e6 + 305fd58 commit a3b2f60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/@ama-sdk/core/src/clients/api-beacon-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ const DEFAULT_OPTIONS: Omit<BaseApiBeaconClientOptions, 'basePath'> = {
* Determine if the given value is a promise
* @param value The value to test
*/
const isPromise = <T>(value: T | Promise<T>): value is Promise<T> => value && typeof (value as any).then === 'function';
// NOTE: the `extends unknown` is required for ESM build with TSC
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint
const isPromise = <T extends unknown>(value: T | Promise<T>): value is Promise<T> => value && typeof (value as any).then === 'function';

/**
* The Beacon API client is an implementation of the API Client using the Navigator Beacon API.
Expand Down
3 changes: 1 addition & 2 deletions packages/@ama-sdk/core/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"target": "ES2020"
},
"include": [
"./**/*.spec.ts",
"./schematics/ng-add/mocks/**/*.ts"
"./**/*.spec.ts"
],
"exclude": [
],
Expand Down

0 comments on commit a3b2f60

Please sign in to comment.