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",
"version": "1.2.1",
"version": "1.2.2",
"description": "Get web page's summary",
"author": "syuilo <i@syuilo.com>",
"license": "MIT",

View File

@ -22,7 +22,12 @@ export default async (url: string): Promise<ISummary> => {
: await general(_url);
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;