Skip to content

Commit

Permalink
replace the 'split' term with 'feature flag'
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilianoSanchez committed Nov 13, 2023
1 parent 209a412 commit 815b49b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/__tests__/SplitTreatments.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ describe('SplitTreatments', () => {
}}
</SplitFactory>
);
expect(logSpy).toBeCalledWith('[ERROR] split names must be a non-empty array.');
expect(logSpy).toBeCalledWith('[ERROR] you passed an invalid split name, split name must be a non-empty string.');
expect(logSpy).toBeCalledWith('[ERROR] feature flag names must be a non-empty array.');
expect(logSpy).toBeCalledWith('[ERROR] you passed an invalid feature flag name, feature flag name must be a non-empty string.');

done();
});
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/useSplitTreatments.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ describe('useSplitTreatments', () => {
return null;
})
);
expect(logSpy).toBeCalledWith('[ERROR] split names must be a non-empty array.');
expect(logSpy).toBeCalledWith('[ERROR] you passed an invalid split name, split name must be a non-empty string.');
expect(logSpy).toBeCalledWith('[ERROR] feature flag names must be a non-empty array.');
expect(logSpy).toBeCalledWith('[ERROR] you passed an invalid feature flag name, feature flag name must be a non-empty string.');
});

test('useSplitTreatments must update on SDK events', async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ export interface ISplitTreatmentsChildProps extends ISplitContextValues {
* An object with the treatments with configs for a bulk of feature flags, returned by client.getTreatmentsWithConfig().
* Each existing configuration is a stringified version of the JSON you defined on the Split user interface. For example:
* {
* split1: { treatment: 'on', config: null }
* split2: { treatment: 'off', config: '{"bannerText":"Click here."}' }
* feature1: { treatment: 'on', config: null }
* feature2: { treatment: 'off', config: '{"bannerText":"Click here."}' }
* }
*/
treatments: SplitIO.TreatmentsWithConfig;
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function getStatus(client: SplitIO.IBrowserClient | null): ISplitStatus {

// Input validation utils that will be replaced eventually

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

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

function validateFeatureFlag(maybeFeatureFlag: unknown, item = 'split name'): false | string {
function validateFeatureFlag(maybeFeatureFlag: unknown, item = 'feature flag name'): false | string {
if (maybeFeatureFlag == undefined) {
console.log(`[ERROR] you passed a null or undefined ${item}, ${item} must be a non-empty string.`);
} else if (!isString(maybeFeatureFlag)) {
Expand Down
4 changes: 2 additions & 2 deletions types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ export interface ISplitTreatmentsChildProps extends ISplitContextValues {
* An object with the treatments with configs for a bulk of feature flags, returned by client.getTreatmentsWithConfig().
* Each existing configuration is a stringified version of the JSON you defined on the Split user interface. For example:
* {
* split1: { treatment: 'on', config: null }
* split2: { treatment: 'off', config: '{"bannerText":"Click here."}' }
* feature1: { treatment: 'on', config: null }
* feature2: { treatment: 'off', config: '{"bannerText":"Click here."}' }
* }
*/
treatments: SplitIO.TreatmentsWithConfig;
Expand Down

0 comments on commit 815b49b

Please sign in to comment.