Skip to content

Commit afd9ba9

Browse files
committed
fix: explicit return types and TS6 source compatibility fixes
1 parent b9297b8 commit afd9ba9

8 files changed

Lines changed: 13 additions & 5 deletions

File tree

packages/sdk/fastly/src/api/createOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const defaultOptions: LDOptions = {
88
logger: BasicLogger.get(),
99
};
1010

11-
const createOptions = (options: LDOptions) => {
11+
const createOptions = (options: LDOptions): LDOptions => {
1212
const finalOptions = { ...defaultOptions, ...options };
1313

1414
// The Fastly SDK does not poll LaunchDarkly for updates, so a custom baseUri does not make sense. However, we need
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"ignoreDeprecations": "6.0"
5+
}
6+
}

packages/sdk/react/tsup.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const sharedOptions = {
1212
'@launchdarkly/js-server-sdk',
1313
],
1414
dts: true,
15+
tsconfig: 'tsconfig.build.json',
1516
metafile: true,
1617
};
1718

packages/sdk/shopify-oxygen/src/utils/createOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const defaultOptions: LDOptions & OxygenLDOptions = {
2626
},
2727
};
2828

29-
export const createOptions = (options: LDOptions & OxygenLDOptions = {}) => {
29+
export const createOptions = (options: LDOptions & OxygenLDOptions = {}): LDOptions & OxygenLDOptions => {
3030
const finalOptions = {
3131
...defaultOptions,
3232
...options,

packages/shared/akamai-edgeworker-sdk/src/utils/createOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const defaultOptions: LDOptions = {
88
logger: BasicLogger.get(),
99
};
1010

11-
export const createOptions = (options: LDOptions) => {
11+
export const createOptions = (options: LDOptions): LDOptions => {
1212
const finalOptions = { ...defaultOptions, ...options };
1313
finalOptions.logger?.debug(`Using LD options: ${JSON.stringify(finalOptions)}`);
1414
return finalOptions;

packages/shared/common/__tests__/internal/events/EventProcessor.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const mockSendEventData = jest.fn();
5050
jest.useFakeTimers();
5151

5252
jest.mock('../../../src/internal/events/EventSender', () => ({
53+
__esModule: true,
5354
default: jest.fn(() => ({
5455
sendEventData: mockSendEventData,
5556
})),

packages/shared/sdk-server-edge/src/api/createOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ export const defaultOptions: LDOptions = {
88
logger: BasicLogger.get(),
99
};
1010

11-
const createOptions = (options: LDOptions) => ({ ...defaultOptions, ...options });
11+
const createOptions = (options: LDOptions): LDOptions => ({ ...defaultOptions, ...options });
1212

1313
export default createOptions;

packages/shared/sdk-server/src/store/sortDataSet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function topologicalSort(
5151

5252
while (unvisitedItems.size > 0) {
5353
// Visit the next item, the order we visit doesn't matter.
54-
const key = unvisitedItems.values().next().value;
54+
const key = unvisitedItems.values().next().value!;
5555
visit(key);
5656
}
5757
return sortedItems;

0 commit comments

Comments
 (0)