Skip to content

Question\Enhancement - {parseNumbers: true} when a number isn't a number #201

@Desmodue

Description

@Desmodue

Hi

Probably an edge case but I have some data that is a number but needs to be treated as a string and also data that is a number but needs to remain as a number. So I do need parseNumbers: true.

example postcode=01220
.parse returns { postcode : 1220 }
Which is now invalid.What I would like is { postcode : '01220' }

Another example is telephone number
telephone=012345678
.parse returns { telephone: 12345678 } would like { telephone: '012345678' }

What would be nice is the ability to prefix the value so that it is treated as a string and the prefix stripped ?
option {parseNumbers: true, treatAsTextPrefix: '<'}

telephone=<012345678 would result in { telephone: '012345678'

Or is there some other way to achieve this?

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