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

Enumerable property flag is not respected #48

Open
koopero opened this issue Oct 31, 2018 · 0 comments
Open

Enumerable property flag is not respected #48

koopero opened this issue Oct 31, 2018 · 0 comments

Comments

@koopero
Copy link

koopero commented Oct 31, 2018

The 'enumerable' flag, which is specifically designed to squelch serialization of internal properties, is not respected in object output.

const prettyjson = require('prettyjson')

let data = {
  foo: 1,
  bar: 2
}

Object.defineProperty( data, 'bar', { enumerable: false } )

console.log( JSON.stringify( data, null, 2 ) )
/* Output: 
{
  "foo": 1
}
*/

console.log( prettyjson.render( data ) )
/* Output: 
foo: 1
bar: 2
*/
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