Skip to content

Custom serializer does not support 0 as return value #122

@alex-kinokon

Description

@alex-kinokon
const date = devalue.stringify(value, {
	Numeric: (value) => value instanceof Numeric && value.toJSON(),
});

If Numeric#toJSON() returns 0, there’ll be a DevalueError: Cannot stringify arbitrary non-POJOs error.

Code:

if (value) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions