From ecb81f756a85ec005bfabdc7ba8aed73af0bd060 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Tue, 6 Sep 2022 13:46:42 +0300 Subject: [PATCH] meta to undefined in json --- src/lib/meta.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/meta.ts b/src/lib/meta.ts index 4fd6ceb2..d9fe220e 100644 --- a/src/lib/meta.ts +++ b/src/lib/meta.ts @@ -53,11 +53,18 @@ export class MetaBuilder { build() { const image = this.buildImage() + const params: Record = {} + if (this.title) { + params.title = this.title + } + if (this.description) { + params.description = this.description + } + return meta({ ...this.data, ...image, - title: this.title, - description: this.description, + ...params, }) }