homey-lib
Advanced tools
Comparing version 2.22.1 to 2.22.2
@@ -301,3 +301,3 @@ /* eslint-disable no-restricted-properties */ | ||
} | ||
await this._validateImages(driver.images, 'driver'); | ||
await this._validateImages(driver.images, 'driver', `drivers.${driver.id}`); | ||
} | ||
@@ -564,3 +564,3 @@ | ||
async _validateImages(imagesObj, type) { | ||
async _validateImages(imagesObj, type, errorPath) { | ||
const sizes = ['small', 'large']; | ||
@@ -573,3 +573,3 @@ for (let i = 0; i < sizes.length; i++) { | ||
if (typeof IMAGE_MARKERS[extension] === 'undefined') { | ||
throw new Error(`Invalid image extention: ${extension}`); | ||
throw new Error(`Invalid image extension (${extension})${ errorPath ? ` ${errorPath}.${size}` : ''}: ${join(this._path, imagePath)}`); | ||
} | ||
@@ -583,3 +583,3 @@ | ||
if (!imageBytes.equals(compareBuffer)) { | ||
throw new Error(`Invalid image: ${imagePath}`); | ||
throw new Error(`Invalid image${ errorPath ? ` ${errorPath}.${size}` : ''}: ${join(this._path, imagePath)}`); | ||
} | ||
@@ -591,3 +591,3 @@ | ||
|| imageSize.height !== requiredSize.height) { | ||
throw new Error(`Invalid image size (${imageSize.width}x${imageSize.height}): ${imagePath}\nRequired: ${requiredSize.width}x${requiredSize.height}`); | ||
throw new Error(`Invalid image size (${imageSize.width}x${imageSize.height})${ errorPath ? ` ${errorPath}.${size}` : ''}: ${join(this._path, imagePath)}\nRequired: ${requiredSize.width}x${requiredSize.height}`); | ||
} | ||
@@ -594,0 +594,0 @@ } |
{ | ||
"name": "homey-lib", | ||
"version": "2.22.1", | ||
"version": "2.22.2", | ||
"description": "Shared Library for Homey", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -332,4 +332,4 @@ /* eslint-disable node/no-unpublished-require */ | ||
debug: true, // debug does not validate images | ||
publish: /invalid image extention/i, | ||
verified: /invalid image extention/i, | ||
publish: /invalid image extension/i, | ||
verified: /invalid image extension/i, | ||
}); | ||
@@ -336,0 +336,0 @@ }); |
@@ -175,4 +175,4 @@ /* eslint-disable node/no-unpublished-require */ | ||
debug: true, // debug does not validate images | ||
publish: /invalid image extention/i, | ||
verified: /invalid image extention/i, | ||
publish: /invalid image extension/i, | ||
verified: /invalid image extension/i, | ||
}); | ||
@@ -179,0 +179,0 @@ }); |
Sorry, the diff of this file is too big to display
870498
12170