Project

General

Profile

« Previous | Next » 

Revision 59402

[Library|Trunk]

jsonld parser: complete fix with description as a number instead of string

View differences:

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