feat: Use prettier-eslint to format code
This commit is contained in:
committed by
mrugesh mohapatra
parent
1ba67c4e2b
commit
b13e5fb41a
@ -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);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user