Skip to content

Commit

Permalink
chore: fix code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
critocrito committed Jul 13, 2021
1 parent db7f57d commit 35c22bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/plugin-media/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ export const download = async (from, to) => {
return new Promise((resolve, reject) => {
const dest = fs.createWriteStream(to);

resp.body.on("error", e => reject(e));
dest.on("error", e => reject(e));
resp.body.on("error", (e) => reject(e));
dest.on("error", (e) => reject(e));
dest.on("finish", () => resolve());

resp.body.pipe(dest);
});
};

export const guessFileType = async location => {
export const guessFileType = async (location) => {
const read = fs.createReadStream(location);
const {fileType: ft} = await fileType.stream(read);
read.destroy();
Expand Down
10 changes: 5 additions & 5 deletions packages/plugin-twitter/lib/twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
} from "./entities";

// The requests within a 15 minutes window in milliseconds.
const rateLimit = requests => ((15 * 60) / requests) * 1000;
const rateLimit = (requests) => ((15 * 60) / requests) * 1000;

// FIXME: Refactor to uncouple everything from the logger.
const apiErrors = curry((log, user, e) => {
Expand All @@ -39,7 +39,7 @@ const apiErrors = curry((log, user, e) => {
throw e;
});

export const parseApiErrors = e => {
export const parseApiErrors = (e) => {
if (e[0] && e[0].message != null) return e[0].message;
if (e[0]) return JSON.stringify(e[0]);
if (e.message != null) return e.message;
Expand Down Expand Up @@ -94,7 +94,7 @@ export const followers = (cfg, log, users) => {
return flowP(
[
op,
tapP(rs => log.info(`Fetched ${size(rs)} followers of ${user}.`)),
tapP((rs) => log.info(`Fetched ${size(rs)} followers of ${user}.`)),
caughtP(apiErrors(log, user)),
flow([followersTransform, concat(memo)]),
],
Expand Down Expand Up @@ -125,7 +125,7 @@ export const friends = (cfg, log, users) => {
return flowP(
[
op,
tapP(rs => log.info(`Fetched ${size(rs)} friends of ${user}.`)),
tapP((rs) => log.info(`Fetched ${size(rs)} friends of ${user}.`)),
caughtP(apiErrors(log, user)),
flow([friendsTransform, concat(memo)]),
],
Expand Down Expand Up @@ -162,7 +162,7 @@ export const search = curry((cfg, log, queries) => {
return flowP(
[
op,
tapP(rs =>
tapP((rs) =>
log.info(
`Fetched ${size(rs.statuses)} tweets for the term ${query}`,
),
Expand Down

0 comments on commit 35c22bd

Please sign in to comment.