Skip to content

Commit

Permalink
block "initial" and "box" condition names (#10)
Browse files Browse the repository at this point in the history
* block "initial" and "box" condition names

* changeset
  • Loading branch information
nsaunders authored May 18, 2024
1 parent 70b346f commit 7946320
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/ten-years-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@embellish/react": patch
---

block "initial" and "box" condition names
4 changes: 3 additions & 1 deletion packages/react/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export type OnlyChars<C, S> = S extends `${infer Head}${infer Tail}`
: never
: unknown;

export type ValidConditionName<Name> = Name extends `${Letter}${infer Tail}`
export type ValidConditionName<Name> = Name extends "box" | "initial"
? never
: Name extends `${Letter}${infer Tail}`
? OnlyChars<Letter | Digit, Tail>
: never;

Expand Down

0 comments on commit 7946320

Please sign in to comment.