This commit is contained in:
syuilo 2016-09-15 12:11:07 +09:00
parent 98dd134164
commit b988f05d71
2 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "summaly", "name": "summaly",
"version": "1.2.1", "version": "1.2.2",
"description": "Get web page's summary", "description": "Get web page's summary",
"author": "syuilo <i@syuilo.com>", "author": "syuilo <i@syuilo.com>",
"license": "MIT", "license": "MIT",

View File

@ -20,9 +20,14 @@ export default async (url: string): Promise<ISummary> => {
const summary = plugin const summary = plugin
? await plugin.summary(_url) ? await plugin.summary(_url)
: await general(_url); : await general(_url);
Object.keys(summary).forEach(k => { Object.keys(summary).forEach(k => {
(<any>summary)[k] = (<any>summary)[k].trim(); if ((<any>summary)[k]) {
(<any>summary)[k] = (<any>summary)[k].trim();
if ((<any>summary)[k] == '') {
(<any>summary)[k] = null;
}
}
}); });
return summary; return summary;