summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@codeispoetry.ru>2017-06-21 11:44:24 +0300
committerAndrej Mihajlov <and@codeispoetry.ru>2017-06-21 11:44:24 +0300
commit8ecd87d4df667469414291e81667b10680770f3e (patch)
treec94519586bc53147dfee8c10c6c8173e741c8a3b
parent2c6cb3d3f210caa9c441dd4d16c24ef6e8ad9d7c (diff)
parent37eb662ca3da4c7e13263666a8b08155a130f9e4 (diff)
downloadmullvadvpn-8ecd87d4df667469414291e81667b10680770f3e.tar.xz
mullvadvpn-8ecd87d4df667469414291e81667b10680770f3e.zip
Merge branch 'feature/flow-typed/formatters'
-rw-r--r--app/lib/formatters.js14
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