Skip to content

Commit

Permalink
fixup! fixup! fixup! refactor(client-http,web,server): use a serializ…
Browse files Browse the repository at this point in the history
…able and more simple configuration object
  • Loading branch information
Billlynch committed Oct 26, 2023
1 parent 0f4722c commit a72d2c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/client-http/src/client/ConfidenceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ type ResolveResponse = {
resolvedFlags: ResolvedFlag[];
resolveToken: string;
};
type ConfidenceBaseTypes = { boolSchema: {} } | { doubleSchema: {} } | { intSchema: {} } | { stringSchema: {} };
type ConfidenceSimpleTypes = { boolSchema: {} } | { doubleSchema: {} } | { intSchema: {} } | { stringSchema: {} };
type ConfidenceFlagSchema = {
schema: {
[key: string]: ConfidenceBaseTypes | { structSchema: ConfidenceFlagSchema };
[key: string]: ConfidenceSimpleTypes | { structSchema: ConfidenceFlagSchema };
};
};

Expand Down Expand Up @@ -107,7 +107,7 @@ function resolvedFlagToFlag(flag: ResolvedFlag): Configuration.Flag {
};
}

function parseBaseType(obj: ConfidenceBaseTypes): Configuration.FlagSchema {
function parseBaseType(obj: ConfidenceSimpleTypes): Configuration.FlagSchema {
if ('boolSchema' in obj) {
return 'boolean';
}
Expand Down
2 changes: 1 addition & 1 deletion packages/client-http/src/client/Configuration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Configuration } from './Configuration';
describe('Configuration', () => {
describe('Configuration.Flag.getFlagDetails', () => {
it('should get the value and the schema', () => {
const result = Configuration.FlagValue.traverse(
const result: Configuration.FlagValue<string> = Configuration.FlagValue.traverse(
{
schema: {
a: {
Expand Down
2 changes: 1 addition & 1 deletion packages/client-http/src/client/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export namespace Configuration {
export type Traversed<T, S extends string> = S extends `${infer STEP}.${infer REST}`
? STEP extends keyof T
? Traversed<T[STEP], REST>
: never
: unknown
: S extends keyof T
? T[S]
: never;
Expand Down

0 comments on commit a72d2c5

Please sign in to comment.