Skip to content

Consider deprecating nominal-typebox #132

Description

@SebastienGllmt

Is your feature request related to a problem? Please describe.

The current nominal-typebox implementation is fragile because it copies a lot of Typebox code as-is just to replace the static field

Describe the solution you'd like

Since nominal-typebox was written, a new feature called Type.Unsafe was added to Typebox which allows easily overriding the static property without having to do copy a bunch of Typebox internals like this library does now

For example, in my code instead of using nomial-typebox I just do

import type { FastFlavor } from "@coderspirit/nominal";

export type HexStringNo0x = FastFlavor<string, 'HexStringNo0x'>;

// this gives the same result as the nomial-typebox library, but with no dependency required
const HexStringNo0xTypebox = Type.Unsafe<HexStringNo0x>(Type.RegExp(/^[a-fA-F0-9]+$/)),

Activity

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

    triageHas to be reviewed by maintainers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions