feat: Use prettier-eslint to format code

This commit is contained in:
Bouncey
2019-02-18 19:32:49 +00:00
committed by mrugesh mohapatra
parent 1ba67c4e2b
commit b13e5fb41a
82 changed files with 1767 additions and 1017 deletions

View File

@ -9,7 +9,6 @@ function getExtract(str) {
return str.slice(0, str.indexOf('</p>') + 4);
}
function addResponsiveClass(str) {
return str.replace(/<img/g, '<img class="img-responsive"');
}
@ -22,17 +21,15 @@ export function getMediumFeed() {
}
const items = feed.items
.map(
item => _.pick(item, ['title', 'link', 'isoDate', 'content:encoded'])
)
.map(
(item) => ({
...item,
extract: getExtract(item['content:encoded'])
})
.map(item =>
_.pick(item, ['title', 'link', 'isoDate', 'content:encoded'])
)
.map(item => ({
...item,
extract: getExtract(item['content:encoded'])
}))
.map(item => _.omit(item, ['content:encoded']))
.map(item => ({ ...item, extract: addResponsiveClass(item.extract)}));
.map(item => ({ ...item, extract: addResponsiveClass(item.extract) }));
resolve(items);
});
});