Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add gelf, a gunified elf for managing pvp hypergraphs from elf world #1389

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add array support for writing with put
  • Loading branch information
Tyler Childs committed Oct 21, 2024
commit c0067118354260762484ed06e710b768f7bff545
3 changes: 3 additions & 0 deletions src/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Gun.chain.put = function(data, cb, as){ // I rewrote it :)
}
k && (to.path || (to.path = [])).push(k);
if(!(v = valid(d)) && !(g = Gun.is(d))){
if(as.array && d instanceof Array) {
tmp = {}; Object.keys(d).forEach(function(v,i){ tmp[i] = v }); d = tmp;
}
if(!Object.plain(d)){ ran.err(as, "Invalid data: "+ check(d) +" at " + (as.via.back(function(at){at.get && tmp.push(at.get)}, tmp = []) || tmp.join('.'))+'.'+(to.path||[]).join('.')); return }
var seen = as.seen || (as.seen = []), i = seen.length;
while(i--){ if(d === (tmp = seen[i]).it){ v = d = tmp.link; break } }
Expand Down