diff options
author | Ben Burwell <ben.burwell@trifecta.com> | 2016-09-14 14:56:14 -0400 |
---|---|---|
committer | Ben Burwell <ben.burwell@trifecta.com> | 2016-09-14 14:56:14 -0400 |
commit | 7ce57c859ab914d65df9c659e1a6ef3fde79c63c (patch) | |
tree | 369333e87089337785b9c1d837eb5681cb4ec476 /lib/types.js | |
parent | 318be9790fa3a3b9cfe36c2e5cc186f0e1666ec3 (diff) |
Consolidate into a single library
Diffstat (limited to 'lib/types.js')
-rw-r--r-- | lib/types.js | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/lib/types.js b/lib/types.js deleted file mode 100644 index 38e2b60..0000000 --- a/lib/types.js +++ /dev/null @@ -1,22 +0,0 @@ -var stringToType = function(str, type) { - switch (type) { - case 'number': - if (str.indexOf('.')) { - return parseFloat(str); - } else { - return parseInt(str, 10); - } - case 'string': - return str; - case 'boolean': - if (str === 'true') { - return true; - } else if (str === 'false') { - return false; - } else { - throw new Error('Invalid boolean value ' + str); - } - default: - throw new Error('type', type, 'is not defined'); - } -}; |