refactor(core): remove unnecessary cast (#41960)

The `as any` is no longer needed since `providedIn` can accept `'any'`.

PR Close #41960
This commit is contained in:
Pete Bacon Darwin 2021-05-06 20:24:43 +01:00 committed by Alex Rickabaugh
parent adc732decb
commit d59f2b0d0c
2 changed files with 6 additions and 7 deletions

View File

@ -272,25 +272,24 @@ describe('processNgModuleDocs processor', () => {
});
/**
* This function simulates a TS AST node for the code:
* This function simulates a TypeScript AST node for the code:
*
* ```
* static ɵprov = ɵɵdefineInjectable({
* providedIn: 'xxxx',
* });
* ```
*
*/
function createSymbolWithProvider(providedIn) {
const initializer = {
pos: 0,
end: providedIn.length,
getSourceFile() {
getSourceFile() {
return { text: providedIn };
}
};
const valueDeclaration = { initializer: { arguments: [{ properties: [ { name: { text: 'providedIn' }, initializer } ] } ] } };
const valueDeclaration = { initializer: { arguments: [{ properties: [{ name: { text: 'providedIn' }, initializer }] }] } };
const exportMap = new Map();
exportMap.set('ɵprov', {valueDeclaration});
return {exports: exportMap};
exportMap.set('ɵprov', { valueDeclaration });
return { exports: exportMap };
}

View File

@ -106,7 +106,7 @@ export abstract class Injector {
/** @nocollapse */
static ɵprov = /** @pureOrBreakMyCode */ ɵɵdefineInjectable({
token: Injector,
providedIn: 'any' as any,
providedIn: 'any',
factory: () => ɵɵinject(INJECTOR),
});