Revision 59402
Added by Argiro Kokogiannaki about 4 years ago
modules/uoa-services-library/trunk/ng-openaire-library/src/app/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts | ||
---|---|---|
196 | 196 |
private getDescription(result: any): String[] { |
197 | 197 |
const item = _.get(result, "result.metadata.oaf:entity.oaf:result.description", null); |
198 | 198 |
if (!item) return this.getTitle(result); |
199 |
let descr = Array.isArray(item) ? item[0]:item + ""; // +"" to make string: if description is number descr.substring returns error |
|
199 |
let descr = Array.isArray(item) ? item[0]+ "":item + ""; // +"" to make string: if description is number descr.substring returns error
|
|
200 | 200 |
return [descr?(descr.substring(0,4997)+(descr.substring(0,4997).length == 4997?'...':'')):"" as String]; |
201 | 201 |
} |
202 | 202 |
|
Also available in: Unified diff
[Library|Trunk]
jsonld parser: complete fix with description as a number instead of string