Skip to content

Commit cc66cad

Browse files
Merge branch 'hooks_baseline' into hooks_useSplitManager
2 parents 91aeb65 + 3e726f9 commit cc66cad

23 files changed

Lines changed: 9 additions & 496 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
/lib
55
/es
66
/umd
7+
/types
78
/coverage
89
.scannerwork

src/__tests__/SplitTreatments.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ describe('SplitTreatments', () => {
136136
}}
137137
</SplitFactory>
138138
);
139-
expect(logSpy).toBeCalledWith('[ERROR] split names must be a non-empty array.');
140-
expect(logSpy).toBeCalledWith('[ERROR] you passed an invalid split name, split name must be a non-empty string.');
139+
expect(logSpy).toBeCalledWith('[ERROR] feature flag names must be a non-empty array.');
140+
expect(logSpy).toBeCalledWith('[ERROR] you passed an invalid feature flag name, feature flag name must be a non-empty string.');
141141

142142
done();
143143
});

src/__tests__/useSplitTreatments.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ describe('useSplitTreatments', () => {
152152
return null;
153153
})
154154
);
155-
expect(logSpy).toBeCalledWith('[ERROR] split names must be a non-empty array.');
156-
expect(logSpy).toBeCalledWith('[ERROR] you passed an invalid split name, split name must be a non-empty string.');
155+
expect(logSpy).toBeCalledWith('[ERROR] feature flag names must be a non-empty array.');
156+
expect(logSpy).toBeCalledWith('[ERROR] you passed an invalid feature flag name, feature flag name must be a non-empty string.');
157157
});
158158

159159
test('useSplitTreatments must update on SDK events', async () => {

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ export interface ISplitTreatmentsChildProps extends ISplitContextValues {
191191
* An object with the treatments with configs for a bulk of feature flags, returned by client.getTreatmentsWithConfig().
192192
* Each existing configuration is a stringified version of the JSON you defined on the Split user interface. For example:
193193
* {
194-
* split1: { treatment: 'on', config: null }
195-
* split2: { treatment: 'off', config: '{"bannerText":"Click here."}' }
194+
* feature1: { treatment: 'on', config: null }
195+
* feature2: { treatment: 'off', config: '{"bannerText":"Click here."}' }
196196
* }
197197
*/
198198
treatments: SplitIO.TreatmentsWithConfig;

src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export function getStatus(client: SplitIO.IBrowserClient | null): ISplitStatus {
9999

100100
// Input validation utils that will be replaced eventually
101101

102-
export function validateFeatureFlags(maybeFeatureFlags: unknown, listName = 'split names'): false | string[] {
102+
export function validateFeatureFlags(maybeFeatureFlags: unknown, listName = 'feature flag names'): false | string[] {
103103
if (Array.isArray(maybeFeatureFlags) && maybeFeatureFlags.length > 0) {
104104
const validatedArray: string[] = [];
105105
// Remove invalid values
@@ -125,7 +125,7 @@ export function initAttributes(client: SplitIO.IBrowserClient | null, attributes
125125

126126
const TRIMMABLE_SPACES_REGEX = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/;
127127

128-
function validateFeatureFlag(maybeFeatureFlag: unknown, item = 'split name'): false | string {
128+
function validateFeatureFlag(maybeFeatureFlag: unknown, item = 'feature flag name'): false | string {
129129
if (maybeFeatureFlag == undefined) {
130130
console.log(`[ERROR] you passed a null or undefined ${item}, ${item} must be a non-empty string.`);
131131
} else if (!isString(maybeFeatureFlag)) {

types/SplitClient.d.ts

Lines changed: 0 additions & 64 deletions
This file was deleted.

types/SplitContext.d.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

types/SplitFactory.d.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

types/SplitTreatments.d.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

types/constants.d.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)