type-guardians 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,18 @@
1
+ name: Code Quality
2
+ on: push
3
+ jobs:
4
+ code-quality:
5
+ runs-on: ubuntu-latest
6
+ timeout-minutes: 2
7
+ steps:
8
+ - uses: actions/checkout@v4
9
+ - uses: pnpm/action-setup@v4
10
+ - uses: biomejs/setup-biome@v2
11
+ - uses: actions/setup-node@v4
12
+ with:
13
+ node-version: 22
14
+ cache: 'pnpm'
15
+ - run: pnpm install
16
+ - run: biome ci .
17
+ - run: pnpm ts:check
18
+ - run: pnpm test
package/number.ts ADDED
@@ -0,0 +1,7 @@
1
+ export function isNumber(value: unknown): value is string {
2
+ return typeof value === "number";
3
+ }
4
+
5
+ export function assertNumber(value: unknown): asserts value is number {
6
+ if (typeof value !== "number") throw new TypeError(`Expected a number, received ${typeof value}`);
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "type-guardians",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "repository": "https://github.com/pchalupa/type-guardians",
@@ -11,23 +11,17 @@
11
11
  "author": "pchalupa <chalupa.petr93@gmail.com> (https://github.com/pchalupa)",
12
12
  "license": "MIT",
13
13
  "type": "module",
14
- "exports": {
15
- "./is-number": {
16
- "import": "./is-number.ts",
17
- "default": "./is-number.ts"
18
- },
19
- "./is-string": {
20
- "import": "./is-string.ts",
21
- "default": "./is-string.ts"
22
- }
23
- },
24
14
  "devDependencies": {
25
- "typescript": "^5.8.3",
15
+ "@biomejs/biome": "2.1.4",
16
+ "typescript": "^5.9.2",
26
17
  "vitest": "^3.1.2"
27
18
  },
28
19
  "scripts": {
20
+ "lint": "biome lint .",
21
+ "format": "biome format .",
29
22
  "ts:check": "tsc --noEmit",
30
23
  "test": "vitest run",
31
- "test:watch": "vitest watch"
24
+ "test:watch": "vitest watch",
25
+ "test:coverage": "vitest test --coverage"
32
26
  }
33
27
  }
package/string.ts ADDED
@@ -0,0 +1,7 @@
1
+ export function isString(value: unknown): value is string {
2
+ return typeof value === "string";
3
+ }
4
+
5
+ export function assertString(value: unknown): asserts value is string {
6
+ if (typeof value !== "string") throw new TypeError(`Expected a string, received ${typeof value}`);
7
+ }
package/tsconfig.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "moduleResolution": "bundler",
5
- "forceConsistentCasingInFileNames": true,
6
- "strict": true,
7
- "skipLibCheck": true
8
- }
9
- }
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "moduleResolution": "bundler",
5
+ "forceConsistentCasingInFileNames": true,
6
+ "strict": true,
7
+ "skipLibCheck": true
8
+ }
9
+ }
package/is-number.ts DELETED
@@ -1,3 +0,0 @@
1
- export function isNumber(value: unknown): value is string {
2
- return typeof value === 'number'
3
- }
package/is-string.ts DELETED
@@ -1,3 +0,0 @@
1
- export function isString(value: unknown): value is string {
2
- return typeof value === 'string'
3
- }