Skip to content

Commit 5f830b5

Browse files
committed
Minor tweaks
1 parent e790c3f commit 5f830b5

File tree

13 files changed

+23
-25
lines changed

13 files changed

+23
-25
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
- 22
2121
- 20
2222
steps:
23-
- uses: actions/checkout@v4
24-
- uses: actions/setup-node@v4
23+
- uses: actions/checkout@v5
24+
- uses: actions/setup-node@v5
2525
with:
2626
node-version: ${{ matrix.node-version }}
2727
- run: npm install
@@ -36,20 +36,20 @@ jobs:
3636
- 'latest'
3737
- '~5.9.0'
3838
steps:
39-
- uses: actions/checkout@v4
40-
- uses: actions/setup-node@v4
39+
- uses: actions/checkout@v5
40+
- uses: actions/setup-node@v5
4141
with:
42-
node-version: 20
42+
node-version: 24
4343
- run: npm install
4444
- run: npm install typescript@${{ matrix.typescript-version }}
4545
- run: npx tsc
4646
test-export:
4747
name: Test Module Export
4848
runs-on: ubuntu-latest
4949
steps:
50-
- uses: actions/checkout@v4
51-
- uses: actions/setup-node@v4
50+
- uses: actions/checkout@v5
51+
- uses: actions/setup-node@v5
5252
with:
53-
node-version: 20
53+
node-version: 24
5454
- run: npm install rollup rollup-plugin-dts
5555
- run: npx rollup index.d.ts -p rollup-plugin-dts -d temp

.github/workflows/ts-canary.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
- next
1616
- latest
1717
steps:
18-
- uses: actions/checkout@v4
19-
- uses: actions/setup-node@v4
18+
- uses: actions/checkout@v5
19+
- uses: actions/setup-node@v5
2020
with:
2121
node-version: lts/*
2222
- run: npm install

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"npm-run-all2": "^8.0.4",
5858
"tsd": "^0.33.0",
5959
"typescript": "^5.9.2",
60-
"xo": "^1.2.1"
60+
"xo": "^1.2.2"
6161
},
6262
"tsd": {
6363
"compilerOptions": {

source/internal/keys.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export type LiteralKeyOf<T> = keyof {[K in keyof T as IsLiteral<K> extends true
6464
/**
6565
Get the exact version of the given `Key` in the given object `T`.
6666
67-
Use-case: You known that a number key (e.g. 10) is in an object, but you don't know how it is defined in the object, as a string or as a number (e.g. 10 or '10'). You can use this type to get the exact version of the key. See the example.
67+
Use-case: You know that a number key (e.g. 10) is in an object, but you don't know how it is defined in the object, as a string or as a number (e.g. 10 or '10'). You can use this type to get the exact version of the key. See the example.
6868
6969
@example
7070
```

source/internal/type.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> =
103103
/**
104104
Returns a boolean for whether the given type is `any` or `never`.
105105
106-
This types can be better to use than {@link IfNotAnyOrNever `IfNotAnyOrNever`} in recursive types because it does ***not*** evaluate any branches.
106+
This type can be better to use than {@link IfNotAnyOrNever `IfNotAnyOrNever`} in recursive types because it does not evaluate any branches.
107107
108108
@example
109109
```

source/is-optional-key-of.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface User {
1818
1919
interface Admin {
2020
name: string;
21-
surname?: string
21+
surname?: string;
2222
}
2323
2424
type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;

source/is-readonly-key-of.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface User {
1919
2020
interface Admin {
2121
name: string;
22-
id: string
22+
id: string;
2323
}
2424
2525
type T1 = IsReadonlyKeyOf<User, 'id'>;

source/is-required-key-of.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interface User {
2020
2121
interface Admin {
2222
name: string;
23-
surname?: string
23+
surname?: string;
2424
}
2525
2626
type T1 = IsRequiredKeyOf<User, 'name'>;

source/is-writable-key-of.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interface User {
2020
2121
interface Admin {
2222
name: string;
23-
id: string
23+
id: string;
2424
}
2525
2626
type T1 = IsWritableKeyOf<User, 'name'>;

source/jsonify.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type UndefinedToNull<T> = T extends undefined ? null : T;
1818
type JsonifyList<T extends UnknownArray> = T extends readonly []
1919
? []
2020
: T extends readonly [infer F, ...infer R]
21-
? [F, ...R] extends T // With TS 5.8.3, if `string[] & ['foo']`, `R` is `unknown[]` here, making the infered types neq to the original one
21+
? [F, ...R] extends T // With TS 5.8.3, if `string[] & ['foo']`, `R` is `unknown[]` here, making the inferred types not equal to the original one
2222
? [NeverToNull<Jsonify<F>>, ...JsonifyList<R>]
2323
: [NeverToNull<Jsonify<F>>]
2424
: IsUnknown<T[number]> extends true
@@ -45,7 +45,7 @@ This includes:
4545
4646
@remarks
4747
48-
An interface cannot be structurally compared to `JsonValue` because an interface can be re-opened to add properties that may not be satisfy `JsonValue`.
48+
An interface cannot be structurally compared to `JsonValue` because an interface can be re-opened to add properties that may not satisfy `JsonValue`.
4949
5050
@example
5151
```
@@ -72,7 +72,7 @@ const fixedFn = <T>(data: Jsonify<T>) => {
7272
};
7373
7474
fixedFn(point); // Good: point is assignable. Jsonify<T> transforms Geometry into value assignable to JsonValue
75-
fixedFn(new Date()); // Error: As expected, Date is not assignable. Jsonify<T> cannot transforms Date into value assignable to JsonValue
75+
fixedFn(new Date()); // Error: As expected, Date is not assignable. Jsonify<T> cannot transform Date into a value assignable to JsonValue
7676
```
7777
7878
Non-JSON values such as `Date` implement `.toJSON()`, so they can be transformed to a value assignable to `JsonValue`:

0 commit comments

Comments
 (0)