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:
parent
adc732decb
commit
d59f2b0d0c
|
@ -272,14 +272,13 @@ 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 = {
|
||||
|
@ -289,8 +288,8 @@ function createSymbolWithProvider(providedIn) {
|
|||
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 };
|
||||
}
|
|
@ -106,7 +106,7 @@ export abstract class Injector {
|
|||
/** @nocollapse */
|
||||
static ɵprov = /** @pureOrBreakMyCode */ ɵɵdefineInjectable({
|
||||
token: Injector,
|
||||
providedIn: 'any' as any,
|
||||
providedIn: 'any',
|
||||
factory: () => ɵɵinject(INJECTOR),
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue