diff --git a/dist/nimn.js b/dist/nimn.js index 37694ab..65db36b 100644 --- a/dist/nimn.js +++ b/dist/nimn.js @@ -441,8 +441,10 @@ StringType.prototype._encode = function (v){ return chars.nilPremitive; }else if(v === ""){ return chars.emptyPremitive; + }else{ + v = "" + v; + return this._sanitize(v); } - //return stringValues[v] || sanitize(v); }; StringType.prototype._decode = function(v,i){ if( inRange(v[i])){ diff --git a/src/stringType.js b/src/stringType.js index 5e0a8db..ac0968a 100644 --- a/src/stringType.js +++ b/src/stringType.js @@ -27,8 +27,10 @@ StringType.prototype._encode = function (v){ return chars.nilPremitive; }else if(v === ""){ return chars.emptyPremitive; + }else{ + v = "" + v; + return this._sanitize(v); } - //return stringValues[v] || sanitize(v); }; StringType.prototype._decode = function(v,i){ if( inRange(v[i])){