Skip to content

Commit 8d33100

Browse files
committed
refactor(types): migrate from tsd to tstyche
1 parent 35dd3a7 commit 8d33100

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
"c8": "^11.0.0",
1616
"eslint": "^9.17.0",
1717
"neostandard": "^0.13.0",
18-
"tsd": "^0.33.0"
18+
"tstyche": "^7.0.0"
1919
},
2020
"scripts": {
2121
"lint": "eslint",
2222
"lint:fix": "eslint --fix",
2323
"test": "npm run test:unit && npm run test:typescript",
24-
"test:typescript": "tsd",
24+
"test:typescript": "tstyche",
2525
"test:unit": "c8 --100 node --test"
2626
},
2727
"repository": {
@@ -75,4 +75,4 @@
7575
}
7676
],
7777
"license": "MIT"
78-
}
78+
}

types/index.test-d.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

types/index.tst.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import safeRegex, { safeRegex as safeRegexNamed } from '..'
2+
import { expect } from 'tstyche'
3+
4+
expect(safeRegex('regex')).type.toBe<boolean>()
5+
expect(safeRegex(/regex/)).type.toBe<boolean>()
6+
expect(safeRegex('^[a-zA-Z0-9]+(?:\\s[a-zA-Z0-9]+)*$')).type.toBe<boolean>()
7+
expect(safeRegex(/^[a-zA-Z0-9]+(?:\s[a-zA-Z0-9]+)*$/g)).type.toBe<boolean>()
8+
9+
expect(safeRegexNamed('regex')).type.toBe<boolean>()
10+
expect(safeRegexNamed(/regex/)).type.toBe<boolean>()
11+
expect(safeRegexNamed('^[a-zA-Z0-9]+(?:\\s[a-zA-Z0-9]+)*$')).type.toBe<boolean>()
12+
expect(safeRegexNamed(/^[a-zA-Z0-9]+(?:\s[a-zA-Z0-9]+)*$/g)).type.toBe<boolean>()

0 commit comments

Comments
 (0)