File tree Expand file tree Collapse file tree
src/app/core/metadata/schema-json-ld/schema-types/product Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { isNotEmpty } from '../../../../../shared/empty.util' ;
12import { Item } from '../../../../shared/item.model' ;
23import { SchemaType } from '../schema-type' ;
34import { schemaJsonLDForEntity } from '../schema-type-decorator' ;
@@ -6,14 +7,11 @@ import { schemaJsonLDForEntity } from '../schema-type-decorator';
67export 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' ,
You can’t perform that action at this time.
0 commit comments