From ea22f8cc5fdaf6deac52f437997ac863b52d32f2 Mon Sep 17 00:00:00 2001 From: Wentao Kuang Date: Mon, 13 Jan 2025 10:49:41 +1300 Subject: [PATCH] Update packages/cogify/src/cogify/cli/cli.cover.ts Co-authored-by: Blayne Chard --- packages/cogify/src/cogify/cli/cli.cover.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/cogify/src/cogify/cli/cli.cover.ts b/packages/cogify/src/cogify/cli/cli.cover.ts index 0b97f2d11..e28be439e 100644 --- a/packages/cogify/src/cogify/cli/cli.cover.ts +++ b/packages/cogify/src/cogify/cli/cli.cover.ts @@ -84,9 +84,8 @@ export const BasemapsCogifyCoverCommand = command({ throw new Error(`No collection.json found with imagery: ${im.url.href}`); } - if (im.collection && im.collection['linz:slug']) { - im.name = im.collection['linz:slug'] as string; - } +const slug = im.collection?.['linz:slug'] +if (slug != null) im.name = slug const tms = SupportedTileMatrix.find((f) => f.identifier.toLowerCase() === args.tileMatrix.toLowerCase()); if (tms == null) throw new Error('--tile-matrix: ' + args.tileMatrix + ' not found');