Remove unnecessary casts (#3367)
This commit is contained in:
parent
1ae6629d81
commit
9f00e95e87
|
@ -273,12 +273,12 @@ export abstract class Resource {
|
|||
}
|
||||
|
||||
if (custom) {
|
||||
const provider = (<CustomResourceOptions>opts).provider;
|
||||
const provider = opts.provider;
|
||||
if (provider === undefined) {
|
||||
if (opts.parent) {
|
||||
// If no provider was given, but we have a parent, then inherit the
|
||||
// provider from our parent.
|
||||
(<CustomResourceOptions>opts).provider = opts.parent.getProvider(t);
|
||||
opts.provider = opts.parent.getProvider(t);
|
||||
}
|
||||
} else {
|
||||
// If a provider was specified, add it to the providers map under this type's package so that
|
||||
|
|
|
@ -322,7 +322,7 @@ async function prepareResource(label: string, res: Resource, custom: boolean,
|
|||
if (custom) {
|
||||
const customOpts = <CustomResourceOptions>opts;
|
||||
importID = customOpts.import;
|
||||
providerRef = await ProviderResource.register(customOpts.provider);
|
||||
providerRef = await ProviderResource.register(opts.provider);
|
||||
}
|
||||
|
||||
// Collect the URNs for explicit/implicit dependencies for the engine so that it can understand
|
||||
|
|
Loading…
Reference in a new issue