Skip to content

Instantly share code, notes, and snippets.

@vikikamath
Created January 25, 2016 06:06
Show Gist options
  • Save vikikamath/7d8e894b7f81ffec400e to your computer and use it in GitHub Desktop.
Save vikikamath/7d8e894b7f81ffec400e to your computer and use it in GitHub Desktop.
Playing with oboe.js
{
"v":1,
"t":[{
"t":7,
"e":"form",
"f":[{
"t":7,
"e":"label",
"f":["Without Focus Handler"]
},
" ",
{
"t":7,
"e":"input",
"a":{
"value":[]
}
},
" ",
{
"t":7,
"e":"label",
"f":["With Focus Handler"]
},
" ",
{
"t":7,
"e":"input",
"a":{
"value":[]
},
"v":{
"focus":"blah",
"focusin":"blah"
}
}]
}]
}
var oboe = require('oboe');
var fs = require('fs');
oboe(fs.createReadStream( 'blah.json' ))
.node({
'{t e}': function(x, path){
//console.log(path);
if (x.e === "input" && x.v){
delete x.v["focusin"];
}
return;
}
})
.done(function(json){
console.log(JSON.stringify(json));
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment