Merge pull request #3166 from balena-io/init-param-issourcedrive

Init param in correct place
This commit is contained in:
Alexis Svinartchouk 2020-05-21 16:22:54 +02:00 committed by GitHub
commit 959b9ffbac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,8 +58,10 @@ export interface Image {
* In the context of Etcher, a source drive is a drive * In the context of Etcher, a source drive is a drive
* containing the image. * containing the image.
*/ */
export function isSourceDrive(drive: DrivelistDrive, image: Image): boolean { export function isSourceDrive(
image = image || {}; drive: DrivelistDrive,
image: Image = {},
): boolean {
for (const mountpoint of drive.mountpoints || []) { for (const mountpoint of drive.mountpoints || []) {
if (image.path !== undefined && pathIsInside(image.path, mountpoint.path)) { if (image.path !== undefined && pathIsInside(image.path, mountpoint.path)) {
return true; return true;