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

node has data and has sub nodes question #11

Open
killmenot opened this issue Sep 7, 2017 · 4 comments
Open

node has data and has sub nodes question #11

killmenot opened this issue Sep 7, 2017 · 4 comments

Comments

@killmenot
Copy link
Contributor

@robtweed Please take a look:

if (defined === 1 || defined === 11) {
document[index] = db.get(node).data;
if (document[index] === 'true') document[index] = true;
if (document[index] === 'false') document[index] = false;
//document[index] = removeDoubleQuotes(document[index], db);
}
if (defined === 10 || defined === 11) {
document[index] = getSubnodes(node);
}

What if node has data and has sub nodes (defined = 11)? In this case data set on line 97 was replaced on line 103. Is it correct?

@robtweed
Copy link
Owner

robtweed commented Sep 7, 2017

Yes - Global storage differs from JSON storage in that a Global can have a data value at an intermediate node. JSON can only have data at a leaf node. My decision was to ignore any data that might exist in an intermediate node and continue down the node hierarchy, when converting to a JSON document

@killmenot
Copy link
Contributor Author

@robtweed I may be wrong but seems we can skip call

document[index] = db.get(node).data

for defined = 11 because it will be overwritten anyway, isn't it? We need db.get only for defined = 1. Please correct me if I'm wrong

@robtweed
Copy link
Owner

robtweed commented Sep 8, 2017

I suspect you're right

@robtweed
Copy link
Owner

I'll fix in next build update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants