Skip to content

Commit d8a3445

Browse files
Polishing
1 parent b352f71 commit d8a3445

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

src/sync/streaming/UpdateWorkers/__tests__/SplitsUpdateWorker.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ describe('SplitsUpdateWorker', () => {
219219
const splitUpdateWorker = SplitsUpdateWorker(loggerMock, cache, splitsSyncTask, telemetryTracker);
220220
const payload = notification.decoded;
221221
const changeNumber = payload.changeNumber;
222-
splitUpdateWorker.put( { changeNumber, pcn }, payload); // queued
222+
splitUpdateWorker.put({ changeNumber, pcn }, payload); // queued
223223
expect(splitsSyncTask.execute).toBeCalledTimes(1);
224-
expect(splitsSyncTask.execute.mock.calls[0]).toEqual([true, undefined, {changeNumber, payload}]);
224+
expect(splitsSyncTask.execute.mock.calls[0]).toEqual([true, undefined, { changeNumber, payload }]);
225225
});
226226
});
227227

@@ -265,7 +265,7 @@ describe('SplitsUpdateWorker', () => {
265265
splitUpdateWorker = SplitsUpdateWorker(loggerMock, cache, splitsSyncTask, telemetryTracker);
266266
splitUpdateWorker.put({ changeNumber, pcn }, notification.decoded);
267267
expect(splitsSyncTask.execute).toBeCalledTimes(1);
268-
expect(splitsSyncTask.execute.mock.calls[0]).toEqual([true, undefined, {payload: notification.decoded, changeNumber }]);
268+
expect(splitsSyncTask.execute.mock.calls[0]).toEqual([true, undefined, { payload: notification.decoded, changeNumber }]);
269269

270270
});
271271
});

types/splitio.d.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ declare namespace SplitIO {
8383
interface ISettings {
8484
readonly core: {
8585
authorizationKey: string;
86-
key: SplitIO.SplitKey;
86+
key: SplitKey;
8787
labelsEnabled: boolean;
8888
IPAddressesEnabled: boolean;
8989
};
@@ -109,25 +109,25 @@ declare namespace SplitIO {
109109
retriesOnFailureBeforeReady: number;
110110
eventsFirstPushWindow: number;
111111
};
112-
readonly storage: SplitIO.StorageSyncFactory | SplitIO.StorageAsyncFactory | SplitIO.StorageOptions;
112+
readonly storage: StorageSyncFactory | StorageAsyncFactory | StorageOptions;
113113
readonly urls: {
114114
events: string;
115115
sdk: string;
116116
auth: string;
117117
streaming: string;
118118
telemetry: string;
119119
};
120-
readonly integrations?: SplitIO.IntegrationFactory[];
121-
readonly debug: boolean | LogLevel | SplitIO.ILogger;
120+
readonly integrations?: IntegrationFactory[];
121+
readonly debug: boolean | LogLevel | ILogger;
122122
readonly version: string;
123123
/**
124124
* Mocked features map if using in client-side, or mocked features file path string if using in server-side (NodeJS).
125125
*/
126-
features: SplitIO.MockedFeaturesMap | SplitIO.MockedFeaturesFilePath;
126+
features: MockedFeaturesMap | MockedFeaturesFilePath;
127127
readonly streamingEnabled: boolean;
128128
readonly sync: {
129-
splitFilters: SplitIO.SplitFilter[];
130-
impressionsMode: SplitIO.ImpressionsMode;
129+
splitFilters: SplitFilter[];
130+
impressionsMode: ImpressionsMode;
131131
enabled: boolean;
132132
flagSpecVersion: string;
133133
requestOptions?: {
@@ -138,11 +138,11 @@ declare namespace SplitIO {
138138
ip: string | false;
139139
hostname: string | false;
140140
};
141-
readonly impressionListener?: SplitIO.IImpressionListener;
141+
readonly impressionListener?: IImpressionListener;
142142
/**
143143
* User consent status if using in client-side. Undefined if using in server-side (NodeJS).
144144
*/
145-
readonly userConsent?: SplitIO.ConsentStatus;
145+
readonly userConsent?: ConsentStatus;
146146
}
147147
/**
148148
* Log levels.
@@ -191,12 +191,12 @@ declare namespace SplitIO {
191191
*
192192
* @returns The user consent status.
193193
*/
194-
getStatus(): SplitIO.ConsentStatus;
194+
getStatus(): ConsentStatus;
195195
/**
196196
* Consent status constants. Use this to compare with the getStatus function result.
197197
*/
198198
Status: {
199-
[status in SplitIO.ConsentStatus]: SplitIO.ConsentStatus;
199+
[status in ConsentStatus]: ConsentStatus;
200200
};
201201
}
202202
/**
@@ -382,7 +382,7 @@ declare namespace SplitIO {
382382
*/
383383
type ImpressionData = {
384384
impression: ImpressionDTO;
385-
attributes?: SplitIO.Attributes;
385+
attributes?: Attributes;
386386
ip: string | false;
387387
hostname: string | false;
388388
sdkLanguageVersion: string;
@@ -526,7 +526,7 @@ declare namespace SplitIO {
526526
* @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#listener}
527527
*/
528528
interface IImpressionListener {
529-
logImpression(data: SplitIO.ImpressionData): void;
529+
logImpression(data: ImpressionData): void;
530530
}
531531
/**
532532
* SDK integration instance.
@@ -573,20 +573,20 @@ declare namespace SplitIO {
573573
/**
574574
* The type of Split data.
575575
*/
576-
type: 'IMPRESSION',
576+
type: 'IMPRESSION';
577577
/**
578578
* The impression data.
579579
*/
580-
payload: SplitIO.ImpressionData
580+
payload: ImpressionData;
581581
} | {
582582
/**
583583
* The type of Split data.
584584
*/
585-
type: 'EVENT',
585+
type: 'EVENT';
586586
/**
587587
* The event data.
588588
*/
589-
payload: SplitIO.EventData
589+
payload: EventData;
590590
};
591591
/**
592592
* Available URL settings for the SDKs.
@@ -665,7 +665,7 @@ declare namespace SplitIO {
665665
*
666666
* @defaultValue `undefined`
667667
*/
668-
impressionListener?: SplitIO.IImpressionListener;
668+
impressionListener?: IImpressionListener;
669669
/**
670670
* SDK synchronization settings.
671671
*/
@@ -681,7 +681,7 @@ declare namespace SplitIO {
681681
* ]
682682
* ```
683683
*/
684-
splitFilters?: SplitIO.SplitFilter[];
684+
splitFilters?: SplitFilter[];
685685
/**
686686
* Impressions Collection Mode. Option to determine how impressions are going to be sent to Split servers.
687687
* Possible values are 'DEBUG', 'OPTIMIZED', and 'NONE'.
@@ -691,7 +691,7 @@ declare namespace SplitIO {
691691
*
692692
* @defaultValue `'OPTIMIZED'`
693693
*/
694-
impressionsMode?: SplitIO.ImpressionsMode;
694+
impressionsMode?: ImpressionsMode;
695695
/**
696696
* Custom options object for HTTP(S) requests.
697697
* If provided, this object is merged with the options object passed by the SDK for EventSource and Fetch calls.
@@ -782,7 +782,7 @@ declare namespace SplitIO {
782782
*
783783
* @defaultValue `false`
784784
*/
785-
debug?: boolean | LogLevel | SplitIO.ILogger;
785+
debug?: boolean | LogLevel | ILogger;
786786
/**
787787
* Defines an optional list of factory functions used to instantiate SDK integrations.
788788
*
@@ -1241,7 +1241,7 @@ declare namespace SplitIO {
12411241
*
12421242
* @defaultValue `'$HOME/.split'`
12431243
*/
1244-
features?: SplitIO.MockedFeaturesFilePath;
1244+
features?: MockedFeaturesFilePath;
12451245
/**
12461246
* Defines which kind of storage we can instantiate on NodeJS for 'standalone' mode.
12471247
* The only possible storage type is 'MEMORY', which is the default.
@@ -1597,7 +1597,7 @@ declare namespace SplitIO {
15971597
* @param properties - The properties of this event. Values can be string, number, boolean or null.
15981598
* @returns Whether the event was added to the queue successfully or not.
15991599
*/
1600-
track(key: SplitIO.SplitKey, trafficType: string, eventType: string, value?: number, properties?: Properties): boolean;
1600+
track(key: SplitKey, trafficType: string, eventType: string, value?: number, properties?: Properties): boolean;
16011601
}
16021602
/**
16031603
* This represents the interface for the Client instance on server-side with asynchronous storage, like REDIS.
@@ -1687,7 +1687,7 @@ declare namespace SplitIO {
16871687
* @param properties - The properties of this event. Values can be string, number, boolean or null.
16881688
* @returns A promise that resolves to a boolean indicating if the event was added to the queue successfully or not.
16891689
*/
1690-
track(key: SplitIO.SplitKey, trafficType: string, eventType: string, value?: number, properties?: Properties): Promise<boolean>;
1690+
track(key: SplitKey, trafficType: string, eventType: string, value?: number, properties?: Properties): Promise<boolean>;
16911691
}
16921692
interface IClientWithAttributes extends IBasicClient {
16931693
/**

0 commit comments

Comments
 (0)