Skip to content

Add global keywords config option #1280

Closed

Description

@ssalbdivad

Could be used like:

import { configure } from "arktype/config"

configure({
    keywords: {
       "string.email": { message: () => "INVALID EMAIL" }
    }
})

As opposed to:

import { keywords, scope } from "arktype"

const { type } = scope({
    string: scope({
        ...keywords.string,
        email: keywords.string.email.configure({
            message: () => "INVALID EMAIL"
        })
    }).export()
})

// INVALID EMAIL
type("string.email")("foo").toString() //?

Activity

  1. moved this from To do to In progress in arktypeioon Jan 28, 2025
  2. moved this from In progress to Backlog in arktypeioon Jan 29, 2025
  3. moved this from Backlog to In progress in arktypeioon Jan 29, 2025
  4. moved this from In progress to Planned in arktypeioon Jan 29, 2025
  5. moved this from Planned to In progress in arktypeioon Jan 29, 2025
  6. moved this from In progress to Implemented in arktypeioon Feb 1, 2025
  7. moved this from Implemented to Done (merged or closed) in arktypeioon Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Done (merged or closed)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions