WIP - add extractor, generate snippet_data
This commit is contained in:
34
node_modules/xstate/es/mapState.js
generated
vendored
Normal file
34
node_modules/xstate/es/mapState.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
var __values = this && this.__values || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator],
|
||||
i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
};
|
||||
import { matchesState, keys } from './utils';
|
||||
export function mapState(stateMap, stateId) {
|
||||
var e_1, _a;
|
||||
var foundStateId;
|
||||
try {
|
||||
for (var _b = __values(keys(stateMap)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var mappedStateId = _c.value;
|
||||
if (matchesState(mappedStateId, stateId) && (!foundStateId || stateId.length > foundStateId.length)) {
|
||||
foundStateId = mappedStateId;
|
||||
}
|
||||
}
|
||||
} catch (e_1_1) {
|
||||
e_1 = { error: e_1_1 };
|
||||
} finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
} finally {
|
||||
if (e_1) throw e_1.error;
|
||||
}
|
||||
}
|
||||
return stateMap[foundStateId];
|
||||
}
|
||||
//# sourceMappingURL=mapState.js.map
|
||||
Reference in New Issue
Block a user