8000 [feat] `z.number().latitude()` and `z.number().longitude()` · Issue #2600 · colinhacks/zod · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[feat] z.number().latitude() and z.number().longitude() #2600
Open
@hudson-bruno

Description

@hudson-bruno

Latitude and longitude are used in a variety of applications, it feels like this simple validation is missing, currently is possible to validate chaining min and max but it would be better if this validation was abstracted away.

const latitude = z.number().min(-90).max(90)
const longitude = z.number().min(-180).max(180)

// Proposed
const latitude = z.number().latitude()
const longitude = z.number().longitude()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0