make change to lib/unset.js (#1167)

* change stats.radata

* remove stats.radata file creation since fs.writeFil will do it any way

* require path and use last directory of opt file path or use radata

* make unset change
This commit is contained in:
tedd pasta 2021-12-02 20:39:37 -06:00 committed by GitHub
parent 9413142c80
commit d1f13c86c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,10 +1,11 @@
var Gun = (typeof window !== "undefined")? window.Gun : require('../gun');
const rel_ = Gun.val.link._; // '#'
const node_ = Gun.node._; // '_'
const rel_ = '#'; // '#'
const node_ = '_'; // '_'
Gun.chain.unset = function(node){
if( this && node && node[node_] && node[node_].put && node[node_].put[node_] && node[node_].put[node_][rel_] )
if( this && node && node[node_] && node[node_].put && node[node_].put[node_] && node[node_].put[node_][rel_] ){
this.put( { [node[node_].put[node_][rel_]]:null} );
}
return this;
}