Skip to content

Add s.locale() method on schemas #383

@freekh

Description

@freekh

We want to add a s.locale() schema method.
The type of the locale is a subtype of string: s.locale("en_us", "fr_fr") // type: "en_us" | "fr_fr"

NOTE: for optional locales, we're not sure yet. Perhaps: s.locale("en_us").optional("fr_fr"). The type for an optional would be the same as if the locale was not.

The intended way to use it will be:

  1. as keys on s.record() (see Extend s.record to support key validation #384)
  2. as properties on s.object() (see Add .locale() method on s.object #386)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions