mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
Merge pull request #12735 from micalevisk/feat/narrow-inject
feat(common)!: type narrowing allowed injection tokens for `@Inject()`
This commit is contained in:
@@ -6,8 +6,8 @@ cd "$(dirname "$0")"
|
||||
|
||||
cd /tmp/
|
||||
sudo apt-get install build-essential libssl-dev git -y
|
||||
git clone https://github.com/wg/wrk.git wrk
|
||||
git clone --depth=1 https://github.com/wg/wrk.git wrk
|
||||
cd wrk
|
||||
sudo make
|
||||
# move the executable to somewhere in your PATH, ex:
|
||||
sudo cp wrk /usr/local/bin
|
||||
sudo cp wrk /usr/local/bin
|
||||
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
PROPERTY_DEPS_METADATA,
|
||||
SELF_DECLARED_DEPS_METADATA,
|
||||
} from '../../constants';
|
||||
import { ForwardReference, InjectionToken } from '../../interfaces';
|
||||
import { isUndefined } from '../../utils/shared.utils';
|
||||
|
||||
/**
|
||||
@@ -34,8 +35,8 @@ import { isUndefined } from '../../utils/shared.utils';
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Inject<T = any>(
|
||||
token?: T,
|
||||
export function Inject(
|
||||
token?: InjectionToken | ForwardReference,
|
||||
): PropertyDecorator & ParameterDecorator {
|
||||
const injectCallHasArguments = arguments.length > 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user