Remove unnecessary casts (#3367)

This commit is contained in:
CyrusNajmabadi 2019-10-17 17:12:45 -07:00 committed by GitHub
parent 1ae6629d81
commit 9f00e95e87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

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

View file

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