From c11a2731a4dae2f460babf1c340a5acf74ac1894 Mon Sep 17 00:00:00 2001 From: Victor Zhou Date: Wed, 10 Apr 2019 16:19:40 -0400 Subject: [PATCH] Add Flow typing for all files in constants/ and utils/ --- src/constants/icons.js | 1 + src/constants/index.js | 1 + src/constants/pagination.js | 1 + src/utils/get-contact-href.js | 3 ++- src/utils/get-icon.js | 3 ++- src/utils/index.js | 1 + 6 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/constants/icons.js b/src/constants/icons.js index 7d64064..b8b1248 100644 --- a/src/constants/icons.js +++ b/src/constants/icons.js @@ -1,3 +1,4 @@ +// @flow const ICONS = { TWITTER: { path: 'M25.312 6.375c-0.688 1-1.547 1.891-2.531 2.609 0.016 0.219 0.016 0.438 0.016 0.656 0 6.672-5.078 14.359-14.359 14.359-2.859 0-5.516-0.828-7.75-2.266 0.406 0.047 0.797 0.063 1.219 0.063 2.359 0 4.531-0.797 6.266-2.156-2.219-0.047-4.078-1.5-4.719-3.5 0.313 0.047 0.625 0.078 0.953 0.078 0.453 0 0.906-0.063 1.328-0.172-2.312-0.469-4.047-2.5-4.047-4.953v-0.063c0.672 0.375 1.453 0.609 2.281 0.641-1.359-0.906-2.25-2.453-2.25-4.203 0-0.938 0.25-1.797 0.688-2.547 2.484 3.062 6.219 5.063 10.406 5.281-0.078-0.375-0.125-0.766-0.125-1.156 0-2.781 2.25-5.047 5.047-5.047 1.453 0 2.766 0.609 3.687 1.594 1.141-0.219 2.234-0.641 3.203-1.219-0.375 1.172-1.172 2.156-2.219 2.781 1.016-0.109 2-0.391 2.906-0.781z', diff --git a/src/constants/index.js b/src/constants/index.js index 9afe180..2523e9b 100644 --- a/src/constants/index.js +++ b/src/constants/index.js @@ -1,2 +1,3 @@ +// @flow export { default as ICONS } from './icons'; export { default as PAGINATION } from './pagination'; diff --git a/src/constants/pagination.js b/src/constants/pagination.js index 449e3c8..59f06c0 100644 --- a/src/constants/pagination.js +++ b/src/constants/pagination.js @@ -1,3 +1,4 @@ +// @flow const PAGINATION = { PREV_PAGE: '← PREV', NEXT_PAGE: '→ NEXT' diff --git a/src/utils/get-contact-href.js b/src/utils/get-contact-href.js index 3a4854f..c310560 100644 --- a/src/utils/get-contact-href.js +++ b/src/utils/get-contact-href.js @@ -1,4 +1,5 @@ -const getContactHref = (name, contact) => { +// @flow +const getContactHref = (name: string, contact: string) => { let href; switch (name) { diff --git a/src/utils/get-icon.js b/src/utils/get-icon.js index 2c6d57f..283cefa 100644 --- a/src/utils/get-icon.js +++ b/src/utils/get-icon.js @@ -1,6 +1,7 @@ +// @flow import { ICONS } from '../constants'; -const getIcon = (name) => { +const getIcon = (name: string) => { let icon; switch (name) { diff --git a/src/utils/index.js b/src/utils/index.js index 645af97..22881dc 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,2 +1,3 @@ +// @flow export { default as getIcon } from './get-icon'; export { default as getContactHref } from './get-contact-href';