File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 11import { decode } from './decode'
2+ import { encode } from './encode'
23import type { ClubsConfiguration , ClubsFunctionConfigFetcher } from './types'
34
45export const getClubsConfig : (
56 fetcher : ClubsFunctionConfigFetcher
67) => Promise < readonly [ ClubsConfiguration , string ] > = async ( fetcher ) => {
78 const config = await fetcher ( )
8- const decoded = decode ( config )
9- return [ decoded , config ]
9+ const encoded = typeof config === 'string' ? config : encode ( config )
10+ const decoded = typeof config === 'string' ? decode ( config ) : config
11+ return [ decoded , encoded ]
1012}
Original file line number Diff line number Diff line change @@ -402,7 +402,11 @@ export type ClubsFunctionPlugin =
402402 | ClubsFunctionStandardPlugin
403403 | ClubsFunctionThemePlugin
404404
405- export type ClubsFunctionConfigFetcher = ( ) => string | Promise < string >
405+ export type ClubsFunctionConfigFetcher = ( ) =>
406+ | string
407+ | ClubsConfiguration
408+ | Promise < string >
409+ | Promise < ClubsConfiguration >
406410
407411export type ClubsFunctionPluginOptionSetter = < T extends ClubsPluginOptions > (
408412 nextOptions : T
You can’t perform that action at this time.
0 commit comments