Coder-Spirit / Coder-Spirit/nominal

Consider deprecating nominal-typebox

Open
#132 2 comments 1 reaction 0 assignees View on GitHub
triage
Dominant language
TypeScript
Stars
89
Forks
1
PR merge metrics
No merged PRs in 30d

Description

**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

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

export type HexStringNo0x = FastFlavor;

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.