Skip to content

Commit

Permalink
added global constants
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaLim8 committed Nov 1, 2019
1 parent 9bbc209 commit b554b38
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
16 changes: 16 additions & 0 deletions client/src/pages/variables.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const fillerWords = [
'like',
'basically',
'so',
'really',
'especially',
'therefore',
'okay',
'very',
'totally',
'literally',
'actually',
'right',
'but',
]

18 changes: 2 additions & 16 deletions client/src/pages/wordcounter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { fillerWords } from "./variables";

export const wordCounter = (speech, filler, words = []) => {
if (filler === true) words = fillerWords;
words = words ? words.reduce((arr, key) => (arr[key.toLowerCase()] = 0, arr), {}) : {};
Expand All @@ -8,19 +10,3 @@ export const wordCounter = (speech, filler, words = []) => {
});
return words;
}

const fillerWords = [
'like',
'basically',
'so',
'really',
'especially',
'therefore',
'okay',
'very',
'totally',
'literally',
'actually',
'right',
'but',
]

0 comments on commit b554b38

Please sign in to comment.