diff --git a/libs/ngxtension/create-injection-token/src/create-injection-token.ts b/libs/ngxtension/create-injection-token/src/create-injection-token.ts index 5e79e8b1..7a411fc7 100644 --- a/libs/ngxtension/create-injection-token/src/create-injection-token.ts +++ b/libs/ngxtension/create-injection-token/src/create-injection-token.ts @@ -113,10 +113,15 @@ function createProvideFn< factory: (...args: any[]) => TValue, opts: CreateProvideFnOptions = {}, ) { - const { deps = [], multi = false, extraProviders = [] } = opts; + const { + deps = [], + multi = false, + extraProviders = [], + isFunctionValue: isFunctionValueFromOpts = false, + } = opts; return ( value?: TValue | (() => TValue), - isFunctionValue = opts.isFunctionValue ?? false, + isFunctionValue = isFunctionValueFromOpts, ) => { let provider: Provider; if (typeof value !== 'undefined') { @@ -253,10 +258,9 @@ export function createNoopInjectionToken< TOptions = Pick< CreateInjectionTokenOptions<() => void, []>, 'extraProviders' - > & - (TMulti extends true ? { multi: true } : Record) & { - isFunctionValue?: boolean; - }, + > & { isFunctionValue?: boolean } & (TMulti extends true + ? { multi: true } + : Record), >(description: string, options?: TOptions) { type TReturn = TMulti extends true ? Array : TValue;