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,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({
|
* static ɵprov = ɵɵdefineInjectable({
|
||||||
* providedIn: 'xxxx',
|
* providedIn: 'xxxx',
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
function createSymbolWithProvider(providedIn) {
|
function createSymbolWithProvider(providedIn) {
|
||||||
const initializer = {
|
const initializer = {
|
||||||
pos: 0,
|
pos: 0,
|
||||||
end: providedIn.length,
|
end: providedIn.length,
|
||||||
getSourceFile() {
|
getSourceFile() {
|
||||||
return { text: 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();
|
const exportMap = new Map();
|
||||||
exportMap.set('ɵprov', {valueDeclaration});
|
exportMap.set('ɵprov', { valueDeclaration });
|
||||||
return {exports: exportMap};
|
return { exports: exportMap };
|
||||||
}
|
}
|
|
@ -106,7 +106,7 @@ export abstract class Injector {
|
||||||
/** @nocollapse */
|
/** @nocollapse */
|
||||||
static ɵprov = /** @pureOrBreakMyCode */ ɵɵdefineInjectable({
|
static ɵprov = /** @pureOrBreakMyCode */ ɵɵdefineInjectable({
|
||||||
token: Injector,
|
token: Injector,
|
||||||
providedIn: 'any' as any,
|
providedIn: 'any',
|
||||||
factory: () => ɵɵinject(INJECTOR),
|
factory: () => ɵɵinject(INJECTOR),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue