Skip to content

Package JSON specification expects string for specific keys #25

@roydukkey

Description

@roydukkey

For example, peer dependencies can simply be a numeric string ("1", "2", etc.). However, the following code converts such values to numbers (1, 2, etc.).

writeFileSync(config.sourcePath, `${JSON.stringify(source, null, config.indent)}\n`);

At the very least the values should probably maintain the same type in which they are provided. Possible using a replacer like this:

JSON.stringify(source, (key, value) => value);

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