Fixed: remove redundant checks

Also fixes a JSDoc error for annotating optional parameters.
This commit is contained in:
Andrew Hankinson 2022-06-18 15:16:48 +02:00
parent d35c0a6385
commit 1b777c9e62

View File

@ -150,7 +150,7 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
* this tile source.
* @function
* @param {Object|Array} data
* @param {String} optional - url
* @param {String} [url] - url
*/
supports: function( data, url ) {
@ -249,13 +249,6 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
}
}
// normalize the various possible id properties to an internal one
data._id = data["@id"] || data["id"] || data['identifier'] || null;
if (!data._id) {
throw new Error( 'Could not determine a property for the tile source ID.' );
}
if (data.preferredFormats) {
for (var f = 0; f < data.preferredFormats.length; f++ ) {
if ( OpenSeadragon.imageFormatSupported(data.preferredFormats[f]) ) {