Skip to content

Commit ade341f

Browse files
committed
store a reference for provider's option in the instance
1 parent 6652ed0 commit ade341f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export interface ProviderDefinition<T = unknown> {
8888

8989
export interface Provider<TName extends string = string> {
9090
_name: TName
91+
_options: unknown
9192
(ctx: ProviderContext): Awaitable<InitializedProvider | undefined>
9293
}
9394

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ProviderDefinition, ProviderFactory } from './types'
22

33
export function defineFontProvider<TName extends string, TOptions = unknown>(name: TName, provider: ProviderDefinition<TOptions>): ProviderFactory<TName, TOptions> {
4-
return ((options: TOptions) => Object.assign(provider.bind(null, options || {} as TOptions), { _name: name })) as ProviderFactory<TName, TOptions>
4+
return ((options: TOptions) => Object.assign(provider.bind(null, options || {} as TOptions), { _name: name, _options: options })) as ProviderFactory<TName, TOptions>
55
}
66

77
export function prepareWeights({

0 commit comments

Comments
 (0)