Skip to content

Commit 1dbb2ee

Browse files
committed
arkregex release chores
1 parent 032538d commit 1dbb2ee

File tree

14 files changed

+28
-20
lines changed

14 files changed

+28
-20
lines changed

ark/attest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ark/attest",
3-
"version": "0.52.0",
3+
"version": "0.53.0",
44
"license": "MIT",
55
"author": {
66
"name": "David Blass",

ark/docs/components/AutoplayDemo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type AutoplayDemoProps = React.DetailedHTMLProps<
1212
> & { src: string }
1313

1414
export const MainAutoplayDemo = () => (
15-
<AutoplayDemo src="https://github.com/user-attachments/assets/eaace5f0-310e-4fc8-9a95-1c0afc6fd110" />
15+
<AutoplayDemo src="https://github.com/arktypeio/arktype/releases/download/arktype%402.0.0/ArkType2Demo3To1.webm" />
1616
)
1717

1818
export const AutoplayDemo = (props: AutoplayDemoProps) => {

ark/docs/content/docs/blog/arkregex.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ However, that concision comes at a cost. Complex expressions can be hard to unde
1818
playsInline
1919
muted
2020
disablePictureInPicture
21-
src="https://private-user-images.githubusercontent.com/10645823/506446535-73cf79b1-ef0e-4870-86ce-c57af490c8aa.mp4?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjE2NDE3NzksIm5iZiI6MTc2MTY0MTQ3OSwicGF0aCI6Ii8xMDY0NTgyMy81MDY0NDY1MzUtNzNjZjc5YjEtZWYwZS00ODcwLTg2Y2UtYzU3YWY0OTBjOGFhLm1wND9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTEwMjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMDI4VDA4NTExOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJmYTgyN2NhZGQ4NGU5NTA3MDg0NWU4NDU1NjhiMGNkNjJkNmIzM2ZhZmQ0NTRjZTVhY2Q5MjEzZGY2MDQ3MDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.pkDrLsKvjvxuMBk55GUBHiYX-q-rVP9CIZW7_Hs-_lo"
21+
src="https://github.com/arktypeio/arktype/releases/download/arkregex%400.0.1/arkregexDemo.webm"
22+
style={{ marginTop: "-1rem" }}
2223
/>
2324

2425
The `regex` function creates a `Regex` instance with types for `.test()`, `.exec()` and more, statically parsed from native JS syntax:
@@ -57,10 +58,10 @@ We've tried to strike a balance between performance and precision while guarante
5758

5859
If your expression is especially long or complex, TypeScript won't be able to infer it.
5960

60-
If your types start to slow down or you see the dreaded `Type is excessively deep...`, you can manually type your expression using `regex.cast`:
61+
If your types start to slow down or you see the dreaded `Type is excessively deep...`, you can manually type your expression using `regex.as`:
6162

6263
```ts
63-
const complexPattern = regex.cast<`pattern-${string}`, { captures: [string] }>(
64+
const complexPattern = regex.as<`pattern-${string}`, { captures: [string] }>(
6465
"very-long-complex-expression-here"
6566
)
6667
```

ark/docs/public/llms.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ However, that concision comes at a cost. Complex expressions can be hard to unde
369369
playsInline
370370
muted
371371
disablePictureInPicture
372-
src="https://private-user-images.githubusercontent.com/10645823/506446535-73cf79b1-ef0e-4870-86ce-c57af490c8aa.mp4?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjE2NDE3NzksIm5iZiI6MTc2MTY0MTQ3OSwicGF0aCI6Ii8xMDY0NTgyMy81MDY0NDY1MzUtNzNjZjc5YjEtZWYwZS00ODcwLTg2Y2UtYzU3YWY0OTBjOGFhLm1wND9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTEwMjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMDI4VDA4NTExOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJmYTgyN2NhZGQ4NGU5NTA3MDg0NWU4NDU1NjhiMGNkNjJkNmIzM2ZhZmQ0NTRjZTVhY2Q5MjEzZGY2MDQ3MDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.pkDrLsKvjvxuMBk55GUBHiYX-q-rVP9CIZW7_Hs-_lo"
372+
src="https://github.com/arktypeio/arktype/releases/download/arkregex%400.0.1/arkregexDemo.webm"
373+
style={{ marginTop: "-1rem" }}
373374
/>
374375

375376
The `regex` function creates a `Regex` instance with types for `.test()`, `.exec()` and more, statically parsed from native JS syntax:
@@ -387,6 +388,8 @@ const email = regex("^(?<name>\\w+)@(?<domain>\\w+\\.\\w+)$")
387388
// Regex<`${string}@${string}.${string}`, { names: { name: string; domain: `${string}.${string}`; }; ...>
388389
```
389390

391+
All you need to get started is `pnpm install arkregex` (or the equivalent for your package manager of choice) 🎉
392+
390393
### Features
391394

392395
- **Types**: Infers string types for your existing regular expressions, including positional and named captures

ark/fs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ark/fs",
3-
"version": "0.52.0",
3+
"version": "0.53.0",
44
"license": "MIT",
55
"author": {
66
"name": "David Blass",

ark/regex/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ We've tried to strike a balance between performance and precision while guarante
4040

4141
If your expression is especially long or complex, TypeScript won't be able to infer it.
4242

43-
If your types start to slow down or you see the dreaded `Type is excessively deep...`, you can manually type your expression using `regex.cast`:
43+
If your types start to slow down or you see the dreaded `Type is excessively deep...`, you can manually type your expression using `regex.as`:
4444

4545
```ts
46-
const complexPattern = regex.cast<`pattern-${string}`, { captures: [string] }>(
46+
const complexPattern = regex.as<`pattern-${string}`, { captures: [string] }>(
4747
"very-long-complex-expression-here"
4848
)
4949
```

ark/regex/__tests__/regex.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,21 +1321,21 @@ contextualize(() => {
13211321
>(S)
13221322
})
13231323

1324-
describe("regex.cast", () => {
1324+
describe("regex.as", () => {
13251325
it("0 type parameters", () => {
1326-
const S = regex.cast("^hello$")
1326+
const S = regex.as("^hello$")
13271327
attest<Regex<string, {}>>(S)
13281328
attest(S.source).equals("^hello$")
13291329
attest(S.flags).equals("")
13301330
})
13311331

13321332
it("1 type parameter", () => {
1333-
const S = regex.cast<"hello">("^hello$")
1333+
const S = regex.as<"hello">("^hello$")
13341334
attest<Regex<"hello", {}>>(S)
13351335
})
13361336

13371337
it("2 type parameters", () => {
1338-
const S = regex.cast<"hello", { captures: ["hello"]; flags: "gi" }>(
1338+
const S = regex.as<"hello", { captures: ["hello"]; flags: "gi" }>(
13391339
"^(hello)$",
13401340
"gi"
13411341
)

ark/regex/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "arkregex",
33
"description": "A drop-in replacement for new RegExp() with types",
4-
"version": "0.0.1",
4+
"version": "0.0.2",
55
"license": "MIT",
66
"author": {
77
"name": "David Blass",

ark/regex/regex.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export interface RegexParser {
4848
flags?: flags
4949
): regex.parse<src, flags>
5050

51-
cast: <pattern extends string = string, ctx extends RegexContext = {}>(
51+
as: <pattern extends string = string, ctx extends RegexContext = {}>(
5252
src: string,
5353
flags?: Flags
5454
) => Regex<pattern, ctx>
@@ -57,7 +57,7 @@ export interface RegexParser {
5757
export const regex: RegexParser = ((src, flags) =>
5858
new RegExp(src, flags)) as RegexParser
5959

60-
Object.assign(regex, { cast: regex })
60+
Object.assign(regex, { as: regex })
6161

6262
export type regex<
6363
pattern extends string = string,

ark/schema/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ark/schema",
3-
"version": "0.52.0",
3+
"version": "0.53.0",
44
"license": "MIT",
55
"author": {
66
"name": "David Blass",

0 commit comments

Comments
 (0)