diff --git a/lib/types.js b/lib/types.js index cae3609b..796f4841 100644 --- a/lib/types.js +++ b/lib/types.js @@ -9,13 +9,14 @@ var typeParsers = { //the empty parse function var noParse = function(val) { return String(val); -} +}; //returns a function used to convert a specific type (specified by //oid) into a result javascript type var getTypeParser = function(oid, format) { - if (!typeParsers[format]) + if (!typeParsers[format]) { return noParse; + } return typeParsers[format][oid] || noParse; }; @@ -26,7 +27,7 @@ var setTypeParser = function(oid, format, parseFn) { format = 'text'; } typeParsers[format][oid] = parseFn; -} +}; textParsers.init(function(oid, converter) { typeParsers.text[oid] = function(value) { @@ -41,4 +42,4 @@ binaryParsers.init(function(oid, converter) { module.exports = { getTypeParser: getTypeParser, setTypeParser: setTypeParser -} +};