UNPKG

fauton

Version:

A library to test any finite automaton with arbitrary alphabets

17 lines (16 loc) 611 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.generateStateGroupsRecord = void 0; function generateStateGroupsRecord(states, statesGroups) { const statesGroupsRecord = {}; const allStatesSet = new Set(states); statesGroups.forEach((statesGroup, statesGroupIndex) => { statesGroup.forEach((state) => { if (allStatesSet.has(state)) { statesGroupsRecord[state] = statesGroupIndex; } }); }); return statesGroupsRecord; } exports.generateStateGroupsRecord = generateStateGroupsRecord;