From c7ba459a1e455132e3d494d6679c835eebdcef90 Mon Sep 17 00:00:00 2001 From: Anthony Lukach Date: Thu, 17 May 2018 13:39:07 -0600 Subject: [PATCH] Handle missing tags and typeKeywords properties --- packages/arcgis-rest-items/src/items.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/arcgis-rest-items/src/items.ts b/packages/arcgis-rest-items/src/items.ts index 8fff7fa429..dad4fb7ab3 100644 --- a/packages/arcgis-rest-items/src/items.ts +++ b/packages/arcgis-rest-items/src/items.ts @@ -384,8 +384,9 @@ function serializeItem(item: IItem): any { // create a clone so we're not messing with the original const clone = JSON.parse(JSON.stringify(item)); // join keywords and tags... - clone.typeKeywords = item.typeKeywords.join(", "); - clone.tags = item.tags.join(", "); + const { typeKeywords=[], tags=[] } = item; + clone.typeKeywords = typeKeywords.join(", "); + clone.tags = tags.join(", "); // convert .data to .text if (clone.data) { clone.text = JSON.stringify(clone.data);