UNPKG
@webwriter/automaton
Version:
latest (3.0.1)
3.0.1
3.0.0
2.1.1
2.1.0
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
1.0.3
1.0.1
1.0.0
0.8.0
Build, visualize, and interact with different kinds of automata (DFA, NFA, PDA).
@webwriter/automaton
/
src
/
utils
/
transformations
/
NFAtoDFA.ts
9 lines
(6 loc)
•
211 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
import
{
DFA
}
from
'../../automata/dfa'
;
import
{
NFA
}
from
'../../automata/nfa'
;
export
function
NFAtoDFA
(
nfa: NFA
):
DFA
{
const
dfa =
new
DFA
(nfa.
nodes
.
get
(), nfa.
transitions
.
get
());
return
dfa; }