Skip to content

Commit

Permalink
Update babel dependency for security issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jackjennings committed Jul 18, 2019
1 parent 1be647e commit c52dc9f
Show file tree
Hide file tree
Showing 5 changed files with 3,745 additions and 1,775 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"presets": [
"es2015"
"@babel/preset-env"
]
}
31 changes: 21 additions & 10 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,30 @@
Object.defineProperty(exports, "__esModule", {
value: true
});

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
exports["default"] = void 0;

var _kefir = require("kefir");

function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }

function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

var NEVER = _kefir.Kefir.never();

var ZERO = _kefir.Kefir.constant(0);

var ADD1 = function ADD1(x) {
return x + 1;
};

var SUBTRACT1 = function SUBTRACT1(x) {
return x - 1;
};

var ALWAYS = function ALWAYS(x) {
return function () {
return x;
Expand All @@ -32,7 +42,6 @@ var delay = function delay(n, s) {
return i;
});
};

/**
* @typedef {Object} Galvo
* @property {Kefir.Stream} current - Stream emitting the current item of the
Expand Down Expand Up @@ -67,15 +76,17 @@ var delay = function delay(n, s) {
* cycle.previous.log();
* // => ----a---b---c
*/


function galvo(_ref3, collection) {
var _ref3$advance = _ref3.advance,
advance = _ref3$advance === undefined ? NEVER : _ref3$advance,
advance = _ref3$advance === void 0 ? NEVER : _ref3$advance,
_ref3$recede = _ref3.recede,
recede = _ref3$recede === undefined ? NEVER : _ref3$recede,
recede = _ref3$recede === void 0 ? NEVER : _ref3$recede,
_ref3$index = _ref3.index,
index = _ref3$index === undefined ? ZERO : _ref3$index;

index = _ref3$index === void 0 ? ZERO : _ref3$index;
var length = collection.length;

var applyT = function applyT(i, transform) {
return (transform(i) + length) % length;
};
Expand All @@ -87,6 +98,7 @@ function galvo(_ref3, collection) {
return SUBTRACT1;
});
var indexT = index.map(ALWAYS);

var transformations = _kefir.Kefir.merge([nextT, previousT, indexT]);

var currentIndex = transformations.scan(applyT, 0).takeWhile(function () {
Expand All @@ -95,10 +107,8 @@ function galvo(_ref3, collection) {
var current = currentIndex.map(function (i) {
return collection[i];
});

var previousIndex = delay(1, currentIndex);
var previous = delay(1, current);

return {
current: current,
currentIndex: currentIndex,
Expand All @@ -107,4 +117,5 @@ function galvo(_ref3, collection) {
};
}

exports.default = galvo;
var _default = galvo;
exports["default"] = _default;
Loading

0 comments on commit c52dc9f

Please sign in to comment.