Skip to content

Commit e27b86e

Browse files
committed
[DSC-2121] lint fixing and code improving
1 parent 680e2da commit e27b86e

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

src/app/core/metadata/schema-json-ld/schema-types/product/product-creative-work-schema-type.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { isNotEmpty } from '../../../../../shared/empty.util';
12
import { Item } from '../../../../shared/item.model';
23
import { SchemaType } from '../schema-type';
34
import { schemaJsonLDForEntity } from '../schema-type-decorator';
@@ -6,14 +7,11 @@ import { schemaJsonLDForEntity } from '../schema-type-decorator';
67
export class ProductCreativeWorkSchemaType extends SchemaType {
78

89
protected createSchema(item: Item): Record<string, any> {
9-
10-
let description: string;
11-
if (!SchemaType.getMetadataValue(item, 'dc.description')) {
12-
description = SchemaType.getMetadataValue(item, 'dc.description.abstract');
13-
} else {
14-
description = SchemaType.getMetadataValue(item, 'dc.description');
15-
}
16-
10+
11+
const description: string|string[] = isNotEmpty(SchemaType.getMetadataValue(item, 'dc.description')) ?
12+
SchemaType.getMetadataValue(item, 'dc.description') :
13+
SchemaType.getMetadataValue(item, 'dc.description.abstract');
14+
1715
return {
1816
'@context': 'https://schema.org',
1917
'@type': 'CreativeWork',

0 commit comments

Comments
 (0)