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

Nesting tests incorrect #6

Closed
blakef opened this issue Mar 2, 2016 · 0 comments
Closed

Nesting tests incorrect #6

blakef opened this issue Mar 2, 2016 · 0 comments
Assignees
Labels

Comments

@blakef
Copy link
Owner

blakef commented Mar 2, 2016

Nesting isn't working, tests don't cover correctly. This is the expected behaviour:

Examples:

let a = new JSONifier({namespace: 'a'}).add({1:2});
> a.build({nest: true}).next().value
{'a': {'1': '2'}}
> a.build({nest: false}).next().value
{'1': '2'}
> a.build('a').next().value
{'1': '2'}
> a.build().next().value
{'a': {'1': '2'}}

Used with namespaces

> a.build({namespace: 'a', nest: true}).next().value
{'1': '2'}
> a.build({namespace: 'a', nest: true}).next().value
{'a': {'1': '2'}}

This is useful because it allows us to use namespaces as a filter (see #4).

TODO:

Add test which represent these use cases.

@blakef blakef added the bug label Mar 2, 2016
@blakef blakef self-assigned this Mar 2, 2016
@blakef blakef closed this as completed in e6c5d29 Mar 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant