Skip to content

Commit 6038abd

Browse files
authored
Merge pull request #13 from total-typescript/matt/update-to-29-finite-state-machine
Update to 29-finite-state-machine
2 parents eb78a47 + 8b7b3d8 commit 6038abd

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,4 @@
123123
"ts-toolbelt": "^9.6.0",
124124
"zod": "^3.19.1"
125125
}
126-
}
126+
}

src/06-identity-functions/29-finite-state-machine.problem.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// import { F } from "ts-toolbelt";
1+
type NoInfer<T> = [T][T extends any ? 0 : never];
22

33
/**
4-
* Clue: F.NoInfer is part of the solution!
4+
* Clue: NoInfer is part of the solution!
55
*
66
* You'll need to modify the interface below
77
* to get it to work.
@@ -17,7 +17,7 @@ interface FSMConfig<TState extends string> {
1717
}
1818

1919
export const makeFiniteStateMachine = <TState extends string>(
20-
config: FSMConfig<TState>
20+
config: FSMConfig<TState>,
2121
) => config;
2222

2323
const config = makeFiniteStateMachine({

src/06-identity-functions/29-finite-state-machine.solution.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { F } from "ts-toolbelt";
1+
// Before 5.4
2+
type NoInfer<T> = [T][T extends any ? 0 : never];
23

34
interface FSMConfig<TState extends string> {
4-
initial: F.NoInfer<TState>;
5+
initial: NoInfer<TState>;
56
states: Record<
67
TState,
78
{

0 commit comments

Comments
 (0)