javascript - Masking sensitive information in node -


i want mask/hide json values not keys. ex:-

myobject = {"name":"value1","phoneno":"545454545445"} output should below: myobject = {"key1":*****  ***,"key2":*****} 

can please tell me, how can in nodejs? thanks.

how about:

let myobject = { "name": "value1", "phoneno": "545454545445" }; let output = {};  function mask(value: string) {     let maskedvalue = "";     (let = 0; < value.length; i++) {         maskedvalue += "*";     }      return maskedvalue; }  object.keys(myobject).foreach(key => {     output[key] = mask(myobject[key]); });  console.log(output); // object {name: "******", phoneno: "************"} 

(code in playground)


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -