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

setting name introduces inconsistency #33

Closed
rockitbaby opened this issue May 10, 2016 · 0 comments
Closed

setting name introduces inconsistency #33

rockitbaby opened this issue May 10, 2016 · 0 comments
Assignees

Comments

@rockitbaby
Copy link
Contributor

as childKeys are not updated

example:

var oco = require('opencolor')

const tree = oco.parse(`
mightBeRed: #EF665F
subtleYellow: #D8E096
brokenBlue: #21BECF
reducedBlue: #1797A6
`)
tree.traverseTree(false, (entry) => {
  entry.name = entry.name.replace('mightBeRed', 'brightRed')
})

var ocoString = oco.render(tree);

console.log(ocoString);
/*
prints
brightRed: #EF665F
subtleYellow: #D8E096
brokenBlue: #21BECF
reducedBlue: #1797A6
*/

console.log(tree.get('mightBeRed').hexcolor()) // defined

console.log(tree.get('brightRed').hexcolor())

// throws TypeError: Cannot read property 'hexcolor' of undefined
@rockitbaby rockitbaby changed the title setting name introduces inconsitency setting name introduces inconsistency May 10, 2016
@rockitbaby rockitbaby self-assigned this May 10, 2016
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

1 participant