Merge pull request #12735 from micalevisk/feat/narrow-inject

feat(common)!: type narrowing allowed injection tokens for `@Inject()`
This commit is contained in:
Kamil Mysliwiec
2024-11-06 12:53:08 +01:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@@ -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

View File

@@ -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;