Skip to content

cannot stringify function with object literal shorthand syntax #19

@fengzilong

Description

@fengzilong

Repro

var stringify = require( 'javascript-stringify' )

stringify( {
  hello() {}
} )

Current Result

{
  hello: hello() {}
}

it's not a valid JS syntax as missing the function prefix

Expected Result

{
  hello: function hello() {}
}

Related code

'[object Function]': String,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions