File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed
Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 1+ import { FsUserContext } from '@flagsync/node-sdk' ;
2+ import { Identify } from '@vercel/flags' ;
3+
4+ type ExtractParams < T > = T extends ( params : infer P ) => any ? P : never ;
5+
6+ export const createIdentify =
7+ (
8+ callback : (
9+ params : ExtractParams < Identify < FsUserContext > > ,
10+ ) => Promise < FsUserContext > | FsUserContext ,
11+ ) : Identify < FsUserContext > =>
12+ ( params ) =>
13+ callback ( params ) ;
Original file line number Diff line number Diff line change @@ -19,3 +19,5 @@ export {
1919 createJsonFlagAdaptor ,
2020 createNumberFlagAdaptor ,
2121} from './adapter' ;
22+
23+ export { createIdentify } from './identify' ;
Original file line number Diff line number Diff line change 1- export type JsonPrimitive = string | number | boolean | null ;
2- export type JsonValue = JsonPrimitive | JsonObject | JsonArray ;
3- export interface JsonArray extends Array < JsonValue > { }
4- export interface JsonObject {
5- [ key : string ] : JsonValue ;
6- }
1+ export type JsonPrimitive = string | number | boolean | null ;
2+ export type JsonValue = JsonPrimitive | JsonObject | JsonArray ;
3+ export type JsonArray = Array < JsonValue > ;
4+ export interface JsonObject {
5+ [ key : string ] : JsonValue ;
6+ }
You can’t perform that action at this time.
0 commit comments