aboutsummaryrefslogtreecommitdiff
path: root/lib/types.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/types.js')
-rw-r--r--lib/types.js22
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');
- }
-};