Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function routeSaga(routesMap) {
return _regeneratorRuntime.wrap(function routeSaga$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return takeLatest(NAVIGATE, onNavigate, routesMap);
case 2:
case 'end':
return _context2.stop();
}
}
}, _marked2, this);
}
var _ref9 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee7(midiURL) {
var parsedMidi, _MidiIO$getTracksAndM, meta, tracks;
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
while (1) {
switch (_context7.prev = _context7.next) {
case 0:
_context7.next = 2;
return MidiIO.parseMidi(midiURL);
case 2:
parsedMidi = _context7.sent;
_MidiIO$getTracksAndM = MidiIO.getTracksAndMetaFromParsedMidi(parsedMidi), meta = _MidiIO$getTracksAndM.meta, tracks = _MidiIO$getTracksAndM.tracks;
return _context7.abrupt('return', { meta: meta, tracks: tracks });
case 5:
case 'end':
return _context7.stop();
}
}
export function saga(routesMap, history) {
var historyChannel;
return _regeneratorRuntime.wrap(function saga$(_context5) {
while (1) {
switch (_context5.prev = _context5.next) {
case 0:
_context5.next = 2;
return fork(routeSaga, routesMap);
case 2:
_context5.next = 4;
return fork(storeToHistory, routesMap, history);
case 4:
_context5.next = 6;
return call(createHistoryChannel, history);
case 6:
historyChannel = _context5.sent;
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee() {
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return this.loadSound();
case 2:
case 'end':
return _context.stop();
}
}
}, _callee, this);
}));
function filter(pred, s) {
var _iterator5, _isArray5, _i5, _ref5, x;
return _regeneratorRuntime.wrap(function filter$(context$1$0) {
while (1) switch (context$1$0.prev = context$1$0.next) {
case 0:
_iterator5 = s, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _getIterator(_iterator5);
case 1:
if (!_isArray5) {
context$1$0.next = 7;
break;
}
if (!(_i5 >= _iterator5.length)) {
context$1$0.next = 4;
break;
}
return context$1$0.abrupt("break", 17);
function mapcat(f) {
for (var _len3 = arguments.length, ss = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
ss[_key3 - 1] = arguments[_key3];
}
return _regeneratorRuntime.wrap(function mapcat$(context$1$0) {
while (1) switch (context$1$0.prev = context$1$0.next) {
case 0:
return context$1$0.delegateYield(concat.apply(undefined, _toConsumableArray(map.apply(undefined, [f].concat(ss)))), "t0", 1);
case 1:
case "end":
return context$1$0.stop();
}
}, marked0$0[7], this);
}
var _ref2 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(model, Model) {
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
return _context2.abrupt("return", _Promise.resolve(model.destroy()).then(function () {
return model;
}));
case 1:
case "end":
return _context2.stop();
}
}
}, _callee2, this);
}));
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(instrumentName, noteName) {
var noteURL, mp3, mp3Blob;
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
noteURL = instrumentAndNoteNameToRemotePath(instrumentName, noteName);
_context.next = 3;
return fetch(noteURL);
case 3:
mp3 = _context.sent;
_context.next = 6;
return mp3.arrayBuffer();
case 6:
mp3Blob = _context.sent;
return _context.abrupt('return', mp3Blob);
value: _regeneratorRuntime.mark(function destroy(sid) {
var col, remove;
return _regeneratorRuntime.wrap(function destroy$(context$2$0) {
while (1) switch (context$2$0.prev = context$2$0.next) {
case 0:
context$2$0.next = 2;
return this.col;
case 2:
col = context$2$0.sent;
remove = (0, _thunkify2['default'])(col.remove.bind(col));
context$2$0.next = 6;
return remove({ sid: sid });
case 6:
case 'end':
return context$2$0.stop();
}
}, destroy, this);
value: _regeneratorRuntime.mark(function _enumerate() {
var obj = arguments[0] === undefined ? this : arguments[0];
var i;
return _regeneratorRuntime.wrap(function _enumerate$(context$2$0) {
while (1) switch (context$2$0.prev = context$2$0.next) {
case 0:
context$2$0.t0 = _regeneratorRuntime.keys(obj);
case 1:
if ((context$2$0.t1 = context$2$0.t0()).done) {
context$2$0.next = 8;
break;
}
i = context$2$0.t1.value;
if (!(obj.hasOwnProperty(i) && this.__$$.FILTERED_PROPERTIES.indexOf(i) === -1)) {
context$2$0.next = 6;
break;
}