diff options
| author | Andrej Mihajlov <and@codeispoetry.ru> | 2017-06-19 18:41:02 +0300 |
|---|---|---|
| committer | Andrej Mihajlov <and@codeispoetry.ru> | 2017-06-21 11:43:42 +0300 |
| commit | 37eb662ca3da4c7e13263666a8b08155a130f9e4 (patch) | |
| tree | c94519586bc53147dfee8c10c6c8173e741c8a3b | |
| parent | 2c6cb3d3f210caa9c441dd4d16c24ef6e8ad9d7c (diff) | |
| download | mullvadvpn-37eb662ca3da4c7e13263666a8b08155a130f9e4.tar.xz mullvadvpn-37eb662ca3da4c7e13263666a8b08155a130f9e4.zip | |
Add flow annotation for formatters.js
| -rw-r--r-- | app/lib/formatters.js | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/app/lib/formatters.js b/app/lib/formatters.js index 7fd355efde..89d45d44a0 100644 --- a/app/lib/formatters.js +++ b/app/lib/formatters.js @@ -1,17 +1,9 @@ -import assert from 'assert'; - -/** - * Format account number - * @param {string} val account number - */ -export const formatAccount = (val) => { - assert(typeof(val) === 'string', 'account number must be a string'); - +// @flow +export const formatAccount = (val: string): string => { // display number altogether when longer than 12 if(val.length > 12) { return val; } - // display quartets return val.replace(/([0-9]{4})/g, '$1 ').trim(); -}; +};
\ No newline at end of file |
