unset.js 364 B

12345678910
  1. var Gun = (typeof window !== "undefined")? window.Gun : require('../gun');
  2. const rel_ = Gun.val.link._; // '#'
  3. const node_ = Gun.node._; // '_'
  4. Gun.chain.unset = function(node){
  5. if( this && node && node[node_] && node[node_].put && node[node_].put[node_] && node[node_].put[node_][rel_] )
  6. this.put( { [node[node_].put[node_][rel_]]:null} );
  7. return this;
  8. }