From 2deba27805193186549ed6b61a3cfc2828aa790a Mon Sep 17 00:00:00 2001 From: Amit Gupta Date: Tue, 3 Jul 2018 09:37:33 +0530 Subject: [PATCH] stringify integer value for string field --- dist/nimn.js | 4 +++- src/stringType.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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])){