Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fus-ext

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fus-ext - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

lib/cmath.fus

7

changelog.md

@@ -0,1 +1,8 @@

v1.1.0
======
2016-04-16T01:37:04Z
Borrow features from Mate.
v1.0.0

@@ -2,0 +9,0 @@ ======

2

CONTRIBUTING.md

@@ -6,3 +6,3 @@ # Compile

```bash
fus c lib target && node node_modules/babel/bin/babel -d target target && fus c test test-target && node node_modules/babel/bin/babel -d test-target test-target
rm -Rf target && rm -Rf test-target && fus c lib target && node node_modules/babel/bin/babel -d target target && fus c test test-target && node node_modules/babel/bin/babel -d test-target test-target
```

@@ -9,0 +9,0 @@

{
"name": "fus-ext",
"version": "1.0.0",
"version": "1.1.0",
"description": "FutureScript Extension",

@@ -5,0 +5,0 @@ "keywords": ["futurescript", "fus"],

@@ -22,3 +22,3 @@ # FutureScript Extension

```fus
fus 1.3.1
fus 2.0.0
import "./manifest" all

@@ -33,3 +33,3 @@

The following document lists the API. Note that all functions that take 2 or more parameters can also be called using an array argument.
The following document lists the API.

@@ -143,6 +143,8 @@ global

Syntax: `compose(function1, [function2, ...])`
Syntax 1: `compose(function1, [function2, ...])`
Returns the math composition of functions. For example:
Syntax 2: `compose(functionArray)`
Returns the math composition of functions. Functions can be passed as multiple arguments, or a single array argument. For example:
```fus

@@ -149,0 +151,0 @@ a: compose(Math.min, Math.abs)

"use strict";Object.defineProperty(exports, "__esModule", {
value: true
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"); } }; })();
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }

@@ -10,40 +10,639 @@ var _main = require("./main");

var ok_573300145710716007 = function ok_573300145710716007(a) {
return a !== undefined && a !== null;
};var portion, toObject;exports.portion = portion = function fun_573300145710716007(arr) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return a !== undefined && a !== null;
};var dotDotCalc_573300145710716007 = function dotDotCalc_573300145710716007(dotDot, a, b, c) {
var _dotDot;
return (function () {
var startIndex, length, endIndex;
var _ref = args[0] instanceof Array ? (function () {
return args[0];
})() : (function () {
return args;
return (_dotDot = dotDot(a))[b].apply(_dotDot, [a].concat(_toConsumableArray(c)));
};var chainedCompare_573300145710716007 = function chainedCompare_573300145710716007(a, b, c, d, e) {
var calc = function calc(x, y, z) {
if (y === 0) {
return x === z;
} else if (y === 1) {
return x !== z;
} else if (y === 2) {
return x < z;
} else if (y === 3) {
return x > z;
} else if (y === 4) {
return x <= z;
} else if (y === 5) {
return x >= z;
}
};
return calc(a, b, c) && calc(c, d, e);
};var _elementOrUseSelector, _ratioToIndex, _ratioToLength, _reverseToIndex, _positionToIndex, _amountToLength, clone, isEmpty, portion, at, atOrNull, atOrVoid, includes, contains, first, firstOrNull, firstOrVoid, last, lastOrNull, lastOrVoid, single, singleOrNull, singleOrVoid, withMax, withMin, max, min, sum, average, median, product, group, _sort, sort, sortDescending, reverse, except, distinct, union, intersect, flatten, forEach, toObject, join, randomOne, random, takeRandomOne, takeRandom, removeAt, remove, removeAll, removeMatch, removeAllMatch;_elementOrUseSelector = function fun_573300145710716007(element, selector) {
return (function () {
return ok_573300145710716007(selector) ? (function () {
return selector(element);
})() : (function () {
return element;
})();
})();
};exports._ratioToIndex = _ratioToIndex = function fun_573300145710716007(arr, ratio) {
return (function () {
var r;r = Math.round(ratio * arr.length - 0.5);return r <= 0 ? (function () {
return 0;
})() : (function () {
return r > arr.length - 1 ? (function () {
return arr.length - 1;
})() : (function () {
return r;
})();
})();
})();
};exports._ratioToLength = _ratioToLength = function fun_573300145710716007(arr, ratio) {
return (function () {
var r;r = Math.round(ratio * (arr.length + 1) - 0.5);return r <= 0 ? (function () {
return 0;
})() : (function () {
return r > arr.length ? (function () {
return arr.length;
})() : (function () {
return r;
})();
})();
})();
};exports._reverseToIndex = _reverseToIndex = function fun_573300145710716007(arr, reverseIndex) {
return (function () {
return arr.length - 1 - reverseIndex;
})();
};exports._positionToIndex = _positionToIndex = function fun_573300145710716007(arr, pos) {
return (function () {
typeof pos === "number" ? (function () {
return chainedCompare_573300145710716007(0, 2, pos, 2, 1) ? (function () {
pos = { Ratio: pos };
})() : (function () {
return chainedCompare_573300145710716007(-1, 2, pos, 2, 0) ? (function () {
pos = { Reverse: { Ratio: -pos } };
})() : (function () {
return pos < 0 ? (function () {
pos = { Reverse: -pos - 1 };
})() : undefined;
})();
})();
})() : undefined;return typeof pos === "number" ? (function () {
return pos;
})() : (function () {
return ok_573300145710716007(pos) && ok_573300145710716007(pos.Reverse) && ok_573300145710716007(pos.Reverse.Ratio) ? (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_reverseToIndex", [dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_ratioToIndex", [pos.Reverse.Ratio])]);
})() : (function () {
return ok_573300145710716007(pos) && ok_573300145710716007(pos.Reverse) ? (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_reverseToIndex", [pos.Reverse]);
})() : (function () {
return ok_573300145710716007(pos) && ok_573300145710716007(pos.Ratio) ? (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_ratioToIndex", [pos.Ratio]);
})() : (function () {
return (0, _main.fail)();
})();
})();
})();
})();
})();
};exports._amountToLength = _amountToLength = function fun_573300145710716007(arr, amount) {
return (function () {
typeof amount === "number" ? (function () {
return chainedCompare_573300145710716007(0, 2, amount, 2, 1) ? (function () {
amount = { Ratio: amount };
})() : undefined;
})() : undefined;return typeof amount === "number" ? (function () {
return amount;
})() : (function () {
return ok_573300145710716007(amount) && ok_573300145710716007(amount.Ratio) ? (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_ratioToLength", [amount.Ratio]);
})() : (function () {
return (0, _main.fail)();
})();
})();
})();
};exports.clone = clone = function fun_573300145710716007(arr) {
return (function () {
return arr.slice();
})();
};exports.isEmpty = isEmpty = function fun_573300145710716007(arr) {
return (function () {
return arr.length === 0;
})();
};exports.portion = portion = function fun_573300145710716007(arr, startIndex, length, endIndex) {
return (function () {
startIndex = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_positionToIndex", [startIndex]);ok_573300145710716007(length) ? (function () {
length = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_amountToLength", [length]);
})() : undefined;ok_573300145710716007(endIndex) ? (function () {
endIndex = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_positionToIndex", [endIndex]);
})() : undefined;return arr.slice(startIndex, ok_573300145710716007(length) ? (function () {
return startIndex + length;
})() : (function () {
return ok_573300145710716007(endIndex) ? (function () {
return endIndex + 1;
})() : (function () {
return undefined;
})();
})());
})();
};exports.at = at = function fun_573300145710716007(arr, index) {
return (function () {
index = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_positionToIndex", [index]);(0, _main.assert)(Number.isInteger(index) && chainedCompare_573300145710716007(0, 4, index, 2, arr.length));return arr[index];
})();
};exports.atOrNull = atOrNull = function fun_573300145710716007(arr, index) {
return (function () {
return (function () {
try {
return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "at", [index]);
})();
} catch (catch_573300145710716007) {
return (function () {
return null;
})();
} finally {}
})();
})();
};exports.atOrVoid = atOrVoid = function fun_573300145710716007(arr, index) {
return (function () {
return (function () {
try {
return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "at", [index]);
})();
} catch (catch_573300145710716007) {
return (function () {
return undefined;
})();
} finally {}
})();
})();
};exports.includes = includes = function fun_573300145710716007(arr, value) {
return (function () {
return arr.indexOf(value) >= 0;
})();
};exports.contains = contains = includes;exports.first = first = function fun_573300145710716007(arr, predicate) {
return (function () {
var queryResult;queryResult = ok_573300145710716007(predicate) ? (function () {
return arr.filter(predicate);
})() : (function () {
return arr;
})();return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, queryResult, "at", [0]);
})();
};exports.firstOrNull = firstOrNull = function fun_573300145710716007(arr, predicate) {
return (function () {
return (function () {
try {
return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "first", [predicate]);
})();
} catch (catch_573300145710716007) {
return (function () {
return null;
})();
} finally {}
})();
})();
};exports.firstOrVoid = firstOrVoid = function fun_573300145710716007(arr, predicate) {
return (function () {
return (function () {
try {
return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "first", [predicate]);
})();
} catch (catch_573300145710716007) {
return (function () {
return undefined;
})();
} finally {}
})();
})();
};exports.last = last = function fun_573300145710716007(arr, predicate) {
return (function () {
var queryResult;queryResult = ok_573300145710716007(predicate) ? (function () {
return arr.filter(predicate);
})() : (function () {
return arr;
})();return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, queryResult, "at", [queryResult.length - 1]);
})();
};exports.lastOrNull = lastOrNull = function fun_573300145710716007(arr, predicate) {
return (function () {
return (function () {
try {
return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "last", [predicate]);
})();
} catch (catch_573300145710716007) {
return (function () {
return null;
})();
} finally {}
})();
})();
};exports.lastOrVoid = lastOrVoid = function fun_573300145710716007(arr, predicate) {
return (function () {
return (function () {
try {
return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "last", [predicate]);
})();
} catch (catch_573300145710716007) {
return (function () {
return undefined;
})();
} finally {}
})();
})();
};exports.single = single = function fun_573300145710716007(arr, predicate) {
return (function () {
var queryResult;queryResult = ok_573300145710716007(predicate) ? (function () {
return arr.filter(predicate);
})() : (function () {
return arr;
})();(0, _main.assert)(queryResult.length === 1);return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, queryResult, "at", [0]);
})();
};exports.singleOrNull = singleOrNull = function fun_573300145710716007(arr, predicate) {
return (function () {
return (function () {
try {
return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "single", [predicate]);
})();
} catch (catch_573300145710716007) {
return (function () {
return null;
})();
} finally {}
})();
})();
};exports.singleOrVoid = singleOrVoid = function fun_573300145710716007(arr, predicate) {
return (function () {
return (function () {
try {
return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "single", [predicate]);
})();
} catch (catch_573300145710716007) {
return (function () {
return undefined;
})();
} finally {}
})();
})();
};exports.withMax = withMax = function fun_573300145710716007(arr, selector) {
return (function () {
return arr.reduce(function fun_573300145710716007(a, b, index) {
return (function () {
return _elementOrUseSelector(a, selector) > _elementOrUseSelector(b, selector) ? (function () {
return a;
})() : (function () {
return b;
})();
})();
});
})();
};exports.withMin = withMin = function fun_573300145710716007(arr, selector) {
return (function () {
return arr.reduce(function fun_573300145710716007(a, b, index) {
return (function () {
return _elementOrUseSelector(a, selector) < _elementOrUseSelector(b, selector) ? (function () {
return a;
})() : (function () {
return b;
})();
})();
});
})();
};exports.max = max = function fun_573300145710716007(arr, selector) {
return (function () {
return _elementOrUseSelector(dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "withMax", [selector]), selector);
})();
};exports.min = min = function fun_573300145710716007(arr, selector) {
return (function () {
return _elementOrUseSelector(dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "withMin", [selector]), selector);
})();
};exports.sum = sum = function fun_573300145710716007(arr, selector) {
return (function () {
return arr.length === 1 ? (function () {
return _elementOrUseSelector(dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "first", []), selector);
})() : (function () {
return arr.reduce(function fun_573300145710716007(a, b, index) {
return (function () {
return (index === 1 ? (function () {
return _elementOrUseSelector(a, selector);
})() : (function () {
return a;
})()) + _elementOrUseSelector(b, selector);
})();
});
})();
})();
};exports.average = average = function fun_573300145710716007(arr, selector) {
return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "sum", [selector]) / arr.length;
})();
};exports.median = median = function fun_573300145710716007(arr, selector) {
return (function () {
var sorted, a, b, m, n;sorted = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "sort", [selector]);a = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, sorted, "at", [0.5 - Number.EPSILON]);b = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, sorted, "at", [0.5 + Number.EPSILON]);m = _elementOrUseSelector(a, selector);n = _elementOrUseSelector(b, selector);return (m + n) / 2;
})();
};exports.product = product = function fun_573300145710716007(arr, selector) {
return (function () {
return arr.length === 1 ? (function () {
return _elementOrUseSelector(dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "first", []), selector);
})() : (function () {
return arr.reduce(function fun_573300145710716007(a, b, index) {
return (function () {
return (index === 1 ? (function () {
return _elementOrUseSelector(a, selector);
})() : (function () {
return a;
})()) * _elementOrUseSelector(b, selector);
})();
});
})();
})();
};exports.group = group = function fun_573300145710716007(arr, keySelector, valueSelector) {
return (function () {
var sorted, results, comparedKey, elements;return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "isEmpty", []) ? (function () {
return [];
})() : (function () {
sorted = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "sort", [keySelector]);results = [];comparedKey = _elementOrUseSelector(dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, sorted, "first", []), keySelector);elements = [];sorted.forEach(function fun_573300145710716007(m) {
return (function () {
var key;key = _elementOrUseSelector(m, keySelector);key !== comparedKey ? (function () {
results.push([comparedKey, _elementOrUseSelector(elements, valueSelector)]);comparedKey = key;elements = [];
})() : undefined;return elements.push(m);
})();
});results.push([comparedKey, _elementOrUseSelector(elements, valueSelector)]);return results;
})();
})();
};exports._sort = _sort = function fun_573300145710716007(arr, keySelector, isDescending) {
return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "clone", []).sort(function fun_573300145710716007(a, b) {
return (function () {
var a1, b1;a1 = _elementOrUseSelector(a, keySelector);b1 = _elementOrUseSelector(b, keySelector);return a1 < b1 ? (function () {
return isDescending ? (function () {
return 1;
})() : (function () {
return -1;
})();
})() : (function () {
return a1 > b1 ? (function () {
return isDescending ? (function () {
return -1;
})() : (function () {
return 1;
})();
})() : (function () {
return 0;
})();
})();
})();
});
})();
};exports.sort = sort = function fun_573300145710716007(arr, keySelector) {
return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_sort", [keySelector, false]);
})();
};exports.sortDescending = sortDescending = function fun_573300145710716007(arr, keySelector) {
return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_sort", [keySelector, true]);
})();
};exports.reverse = reverse = function fun_573300145710716007(arr) {
return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "clone", []).reverse();
})();
};exports.except = except = function fun_573300145710716007(arr, array, equalityComparer) {
if (equalityComparer === undefined) {
equalityComparer = function fun_573300145710716007(a, b) {
return (function () {
return a === b;
})();
};
}return (function () {
return arr.filter(function fun_573300145710716007(m) {
return (function () {
return !array.some(function fun_573300145710716007(n) {
return (function () {
return equalityComparer(n, m);
})();
});
})();
});
})();
};exports.distinct = distinct = function fun_573300145710716007(arr, equalityComparer) {
if (equalityComparer === undefined) {
equalityComparer = function fun_573300145710716007(a, b) {
return (function () {
return a === b;
})();
};
}return (function () {
var r;r = [];arr.forEach(function fun_573300145710716007(m) {
return (function () {
return !r.some(function fun_573300145710716007(n) {
return (function () {
return equalityComparer(n, m);
})();
}) ? (function () {
return r.push(m);
})() : undefined;
})();
});return r;
})();
};exports.union = union = function fun_573300145710716007(arr, array, equalityComparer) {
return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr.concat(array), "distinct", [equalityComparer]);
})();
};exports.intersect = intersect = function fun_573300145710716007(arr, array, equalityComparer) {
if (equalityComparer === undefined) {
equalityComparer = function fun_573300145710716007(a, b) {
return (function () {
return a === b;
})();
};
}return (function () {
var r;r = [];dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "distinct", [equalityComparer]).forEach(function fun_573300145710716007(m) {
return (function () {
return array.some(function fun_573300145710716007(n) {
return (function () {
return equalityComparer(n, m);
})();
}) ? (function () {
return r.push(m);
})() : undefined;
})();
});return r;
})();
};exports.flatten = flatten = function fun_573300145710716007(arr, level) {
return (function () {
var r, canContinue;return level <= 0 ? (function () {
return (0, _main.fail)();
})() : (function () {
r = [];canContinue = false;arr.forEach(function fun_573300145710716007(m) {
return (function () {
return m instanceof Array ? (function () {
canContinue = true;return m.forEach(function fun_573300145710716007(n) {
return (function () {
return r.push(n);
})();
});
})() : (function () {
return r.push(m);
})();
})();
});return canContinue ? (function () {
return ok_573300145710716007(level) ? (function () {
return level === 1 ? (function () {
return r;
})() : (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, r, "flatten", [level - 1]);
})();
})() : (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, r, "flatten", []);
})();
})() : (function () {
return r;
})();
})();
})();
};exports.forEach = forEach = function fun_573300145710716007(arr, callback) {
return (function () {
arr.every(function fun_573300145710716007(element, index) {
return (function () {
return callback(element, index) === _main["break"] ? (function () {
return false;
})() : (function () {
return true;
})();
})();
});return undefined;
})();
};exports.toObject = toObject = function fun_573300145710716007(arr) {
return (function () {
var r;r = {};arr.forEach(function fun_573300145710716007(element) {
return (function () {
r[element[0]] = element[1];
})();
});return r;
})();
};exports.join = join = function fun_573300145710716007(arr) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var _ref2 = _slicedToArray(_ref, 3);
startIndex = _ref2[0];
length = _ref2[1];
endIndex = _ref2[2];
return arr.slice(startIndex, ok_573300145710716007(length) ? (function () {
return startIndex + length;
})() : (function () {
return ok_573300145710716007(endIndex) ? (function () {
return endIndex + 1;
})() : (function () {
return undefined;
})();
})());
})();
};exports.toObject = toObject = function fun_573300145710716007(arr) {
return (function () {
var r;r = {};arr.forEach(function fun_573300145710716007(element) {
return (function () {
r[element[0]] = element[1];
})();
});return r;
})();
};exports.portion = portion;
exports.toObject = toObject;
return (function () {
args[0] instanceof Array ? (function () {
args = args[0];
})() : undefined;return args.length <= 1 ? (function () {
return arr.join(args[0]);
})() : (function () {
return arr.map(function fun_573300145710716007(m) {
return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, m, "join", [args.slice(0, -1)]);
})();
}).join(dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, args, "last", []));
})();
})();
};exports.randomOne = randomOne = function fun_573300145710716007(arr) {
return (function () {
return arr[dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, Math, "randomInt", [arr.length])];
})();
};exports.random = random = function fun_573300145710716007(arr, count) {
return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "clone", []), "takeRandom", [count]);
})();
};exports.takeRandomOne = takeRandomOne = function fun_573300145710716007(arr) {
return (function () {
var index, r;index = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, Math, "randomInt", [arr.length]);r = arr[index];dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "removeAt", [index]);return r;
})();
};exports.takeRandom = takeRandom = function fun_573300145710716007(arr, count) {
return (function () {
if (count === undefined || count === null) {
count = arr.length;
};count = dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "_amountToLength", [count]);return (0, _main.repeat)(count, function fun_573300145710716007() {
var arg_573300145710716007 = arguments;return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "takeRandomOne", []);
})();
});
})();
};exports.removeAt = removeAt = function fun_573300145710716007(arr, index) {
return (function () {
arr.splice(index, 1);return arr;
})();
};exports.remove = remove = function fun_573300145710716007(arr, element) {
return (function () {
var index;index = arr.indexOf(element);(0, _main.assert)(index > -1);return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "removeAt", [index]);
})();
};exports.removeAll = removeAll = function fun_573300145710716007(arr, element) {
return (function () {
(0, _main.loop)(function () {
return (function () {
var index;index = arr.indexOf(element);return index === -1 ? (function () {
return _main["break"];
})() : (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "removeAt", [index]);
})();
})();
});return arr;
})();
};exports.removeMatch = removeMatch = function fun_573300145710716007(arr, predicate) {
return (function () {
var index;index = arr.findIndex(predicate);(0, _main.assert)(index > -1);return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "removeAt", [index]);
})();
};exports.removeAllMatch = removeAllMatch = function fun_573300145710716007(arr, predicate) {
return (function () {
(0, _main.loop)(function () {
return (function () {
var index;index = arr.findIndex(predicate);return index === -1 ? (function () {
return _main["break"];
})() : (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "removeAt", [index]);
})();
})();
});return arr;
})();
};exports._ratioToIndex = _ratioToIndex;
exports._ratioToLength = _ratioToLength;
exports._reverseToIndex = _reverseToIndex;
exports._positionToIndex = _positionToIndex;
exports._amountToLength = _amountToLength;
exports.clone = clone;
exports.isEmpty = isEmpty;
exports.portion = portion;
exports.at = at;
exports.atOrNull = atOrNull;
exports.atOrVoid = atOrVoid;
exports.includes = includes;
exports.contains = contains;
exports.first = first;
exports.firstOrNull = firstOrNull;
exports.firstOrVoid = firstOrVoid;
exports.last = last;
exports.lastOrNull = lastOrNull;
exports.lastOrVoid = lastOrVoid;
exports.single = single;
exports.singleOrNull = singleOrNull;
exports.singleOrVoid = singleOrVoid;
exports.withMax = withMax;
exports.withMin = withMin;
exports.max = max;
exports.min = min;
exports.sum = sum;
exports.average = average;
exports.median = median;
exports.product = product;
exports.group = group;
exports._sort = _sort;
exports.sort = sort;
exports.sortDescending = sortDescending;
exports.reverse = reverse;
exports.except = except;
exports.distinct = distinct;
exports.union = union;
exports.intersect = intersect;
exports.flatten = flatten;
exports.forEach = forEach;
exports.toObject = toObject;
exports.join = join;
exports.randomOne = randomOne;
exports.random = random;
exports.takeRandomOne = takeRandomOne;
exports.takeRandom = takeRandom;
exports.removeAt = removeAt;
exports.remove = remove;
exports.removeAll = removeAll;
exports.removeMatch = removeMatch;
exports.removeAllMatch = removeAllMatch;

@@ -7,4 +7,14 @@ "use strict";Object.defineProperty(exports, "__esModule", {

var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj["default"] = obj; return newObj; } }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var _sys = require("./sys");

@@ -18,2 +28,14 @@

var _cmath = require("./cmath");
var cmath = _interopRequireWildcard(_cmath);
var _number = require("./number");
var feNumber = _interopRequireWildcard(_number);
var _numberStatic = require("./number-static");
var feNumberStatic = _interopRequireWildcard(_numberStatic);
var _string = require("./string");

@@ -23,2 +45,6 @@

var _object = require("./object");
var feObject = _interopRequireWildcard(_object);
var _array = require("./array");

@@ -28,2 +54,18 @@

var _math = require("./math");
var feMath = _interopRequireWildcard(_math);
var _json = require("./json");
var feJson = _interopRequireWildcard(_json);
var _date = require("./date");
var feDate = _interopRequireWildcard(_date);
var _console = require("./console");
var feConsole = _interopRequireWildcard(_console);
var ok_573300145710716007 = function ok_573300145710716007(a) {

@@ -33,7 +75,24 @@ return a !== undefined && a !== null;

return a === undefined ? b : a;
};var internalLoop, repeat, loop, fail, compose, assert, spread, eventField, dotDot_573300145710716007, var_573300145710716007_0, var_573300145710716007_1;internalLoop = function fun_573300145710716007(_ref) {
var _ref2 = _slicedToArray(_ref, 2);
};var ifnull_573300145710716007 = function ifnull_573300145710716007(a, b) {
return a === undefined || a === null ? b : a;
};var dotDotCalc_573300145710716007 = function dotDotCalc_573300145710716007(dotDot, a, b, c) {
var _dotDot;
var data = _ref2[0];
var enablesReturns = _ref2[1];
return (_dotDot = dotDot(a))[b].apply(_dotDot, [a].concat(_toConsumableArray(c)));
};var formattedRegex_573300145710716007 = function formattedRegex_573300145710716007(pattern, flags) {
var s = pattern;
var lines = s.split("\n");
lines = lines.map(function (line) {
var commentPos = line.indexOf(" #");
var r;
if (commentPos === -1) {
r = line;
} else {
r = line.substr(0, commentPos);
}
return r;
});
s = lines.join("").replace(/\s/g, "");
return new RegExp(s, flags);
};var internalLoop, repeat, loop, fail, compose, assert, spread, eventField, setImmediate, clearImmediate, Timer, IntervalTimer, Observer, Point, dotDot_573300145710716007, var_573300145710716007_0, var_573300145710716007_1;internalLoop = function fun_573300145710716007(data, enablesReturns) {
return (function () {

@@ -92,15 +151,15 @@ var theBreak, results, step, startIndex, endIndex;theBreak = var_573300145710716007_0;results = enablesReturns ? (function () {

return (function () {
return internalLoop([b === undefined ? (function () {
return internalLoop(b === undefined ? (function () {
return a;
})() : (function () {
return [a, b];
})(), true]);
})(), true);
})();
};exports.loop = loop = function fun_573300145710716007(a, b) {
return (function () {
return internalLoop([b === undefined ? (function () {
return internalLoop(b === undefined ? (function () {
return a;
})() : (function () {
return [a, b];
})(), false]);
})(), false);
})();

@@ -151,14 +210,7 @@ };exports["break"] = var_573300145710716007_0 = Symbol();exports["enum"] = var_573300145710716007_1 = function fun_573300145710716007() {

return (function () {
count === undefined ? (function () {
var _value = value;
var _value2 = _slicedToArray(_value, 2);
value = _value2[0];
count = _value2[1];
})() : undefined;return repeat([count, function () {
return repeat(count, function () {
return (function () {
return value;
})();
}]);
});
})();

@@ -171,10 +223,3 @@ };exports.eventField = eventField = function () {

return (function () {
method instanceof Array ? (function () {
var _method = method;
var _method2 = _slicedToArray(_method, 2);
method = _method2[0];
arg = _method2[1];
})() : undefined;method instanceof Function ? (function () {
method instanceof Function ? (function () {
arg = method;method = "bind";

@@ -185,3 +230,3 @@ })() : undefined;assert(typeof method === "string");f[method](arg);return _this2;

return (function () {
return f._listeners.clone();
return dotDotCalc_573300145710716007(dotDot_573300145710716007, f._listeners, "clone", []);
})();

@@ -196,3 +241,3 @@ };f.bind = function fun_573300145710716007(listener) {

return (function () {
f._listeners.removeAll(listener);return f;
dotDotCalc_573300145710716007(dotDot_573300145710716007, f._listeners, "removeAll", [listener]);return f;
})();

@@ -207,3 +252,3 @@ };f.unbindAll = function () {

return (function () {
return (ok_573300145710716007(arg) ? arg.blocksListeners : undefined) ? (function () {
return ok_573300145710716007(arg) && arg.blocksListeners ? (function () {
return false;

@@ -218,14 +263,765 @@ })() : (function () {

})();
};exports.sys = sys;
};exports.setImmediate = setImmediate = function fun_573300145710716007(callback, args) {
return (function () {
return setTimeout(callback, 0, args);
})();
};exports.clearImmediate = clearImmediate = clearTimeout;exports.Timer = Timer = (function () {
var var_573300145710716007_3 = Symbol();var var_573300145710716007_4 = Symbol();var var_573300145710716007_5 = Symbol();var var_573300145710716007_6 = Symbol();var var_573300145710716007_7 = Symbol();var var_573300145710716007_8 = Symbol();var var_573300145710716007_9 = Symbol();var var_573300145710716007_10 = Symbol();var var_573300145710716007_11 = Symbol();var class_573300145710716007 = (function () {
_createClass(class_573300145710716007, null, [{
key: var_573300145710716007_5,
value: function value() {
var _arguments2 = arguments,
_this3 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments2;return (function () {
var base_573300145710716007 = _this3;if (base_573300145710716007[var_573300145710716007_6] === undefined || base_573300145710716007[var_573300145710716007_6] === null) {
base_573300145710716007[var_573300145710716007_6] = setInterval(function () {
return (function () {
return _this3[var_573300145710716007_7].fire();
})();
}, _this3[var_573300145710716007_4]);
};
})();
})();
}
}, {
key: var_573300145710716007_8,
value: function value() {
var _arguments3 = arguments,
_this4 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments3;return (function () {
ok_573300145710716007(_this4[var_573300145710716007_6]) ? (function () {
return clearInterval(_this4[var_573300145710716007_6]);
})() : undefined;_this4[var_573300145710716007_6] = null;
})();
})();
}
}, {
key: "setPrecision",
value: function setPrecision(precision) {
var _this5 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function (precision) {
return (function () {
ok_573300145710716007(_this5[var_573300145710716007_6]) ? (function () {
_this5[var_573300145710716007_8]();_this5[var_573300145710716007_4] = precision;return _this5[var_573300145710716007_5]();
})() : (function () {
_this5[var_573300145710716007_4] = precision;
})();return undefined;
})();
})(precision);
}
}, {
key: "getPrecision",
value: function getPrecision() {
var _arguments4 = arguments,
_this6 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments4;return (function () {
return _this6[var_573300145710716007_4];
})();
})();
}
}, {
key: "getEndOfTime",
value: function getEndOfTime() {
var _arguments5 = arguments,
_this7 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments5;return (function () {
return _this7[var_573300145710716007_3];
})();
})();
}
}]);
function class_573300145710716007(options) {
var _this8 = this;
_classCallCheck(this, class_573300145710716007);
var fun_573300145710716007;(fun_573300145710716007 = function (options) {
return (function () {
var o;o = dotDotCalc_573300145710716007(dotDot_573300145710716007, Object, "absorb", [dotDotCalc_573300145710716007(dotDot_573300145710716007, Object, "clone", [ifvoid_573300145710716007(options, {})]), { targetTime: _this8.constructor[var_573300145710716007_3], allowsEqual: true }]);_this8.targetTime = o.targetTime;_this8.allowsEqual = o.allowsEqual;_this8[var_573300145710716007_9] = 0;_this8[var_573300145710716007_10] = false;_this8.onArrive = eventField();return _this8.run();
})();
})(options);
}
_createClass(class_573300145710716007, [{
key: "run",
value: function run() {
var _arguments6 = arguments,
_this9 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments6;return (function () {
!_this9[var_573300145710716007_10] ? (function () {
_this9[var_573300145710716007_10] = true;_this9.constructor[var_573300145710716007_5]();_this9[var_573300145710716007_11] = function () {
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments6;return (function () {
var nowTime, lastTargetTime;nowTime = new Date();return (_this9.allowsEqual ? (function () {
return nowTime >= _this9.targetTime;
})() : (function () {
return nowTime > _this9.targetTime;
})()) ? (function () {
var base_573300145710716007 = _this9;base_573300145710716007[var_573300145710716007_9] = base_573300145710716007[var_573300145710716007_9] + 1;lastTargetTime = _this9.targetTime;_this9.targetTime = _this9.constructor[var_573300145710716007_3];return _this9.onArrive.fire({ idealTime: lastTargetTime, nowTime: nowTime, index: _this9[var_573300145710716007_9] - 1 });
})() : undefined;
})();
})();
};return _this9.constructor[var_573300145710716007_7].bind(_this9[var_573300145710716007_11]);
})() : undefined;return _this9;
})();
})();
}
}, {
key: "stop",
value: function stop() {
var _arguments7 = arguments,
_this10 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments7;return (function () {
_this10[var_573300145710716007_10] ? (function () {
_this10[var_573300145710716007_10] = false;_this10.constructor[var_573300145710716007_7].unbind(_this10[var_573300145710716007_11]);return dotDotCalc_573300145710716007(dotDot_573300145710716007, _this10.constructor[var_573300145710716007_7].getListeners(), "isEmpty", []) ? (function () {
return _this10.constructor[var_573300145710716007_8]();
})() : undefined;
})() : undefined;return _this10;
})();
})();
}
}, {
key: "getRunning",
value: function getRunning() {
var _arguments8 = arguments,
_this11 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments8;return (function () {
return _this11[var_573300145710716007_10];
})();
})();
}
}, {
key: "resetCounter",
value: function resetCounter() {
var _arguments9 = arguments,
_this12 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments9;return (function () {
_this12[var_573300145710716007_9] = 0;return _this12;
})();
})();
}
}, {
key: "getCounter",
value: function getCounter() {
var _arguments10 = arguments,
_this13 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments10;return (function () {
return _this13[var_573300145710716007_9];
})();
})();
}
}]);
return class_573300145710716007;
})();class_573300145710716007[var_573300145710716007_3] = new Date("9999-12-30T00:00:00Z");class_573300145710716007[var_573300145710716007_4] = 30;class_573300145710716007[var_573300145710716007_7] = eventField();return class_573300145710716007;
})();exports.IntervalTimer = IntervalTimer = (function () {
var var_573300145710716007_12 = Symbol();var class_573300145710716007 = (function (_Timer) {
_inherits(class_573300145710716007, _Timer);
function class_573300145710716007(options) {
var _this14 = this;
_classCallCheck(this, class_573300145710716007);
var fun_573300145710716007;(fun_573300145710716007 = function (options) {
return (function () {
var o;_get(Object.getPrototypeOf(class_573300145710716007.prototype), "constructor", _this14).call(_this14, options);o = dotDotCalc_573300145710716007(dotDot_573300145710716007, Object, "absorb", [dotDotCalc_573300145710716007(dotDot_573300145710716007, Object, "clone", [ifvoid_573300145710716007(options, {})]), { interval: 1000, startTime: new Date(), endTime: dotDotCalc_573300145710716007(dotDot_573300145710716007, _this14.constructor.getEndOfTime(), "subtract", [1000]), includesStart: true, includesEnd: false, skipsPast: false }]);_this14.interval = o.interval;_this14.startTime = o.startTime;_this14.endTime = o.endTime;_this14.includesStart = o.includesStart;_this14.includesEnd = o.includesEnd;_this14.skipsPast = o.skipsPast;_this14.targetTime = _this14.startTime;_this14[var_573300145710716007_12] = false;_this14.onStart = eventField();return _this14.onArrive.bind(function (event) {
var fun_573300145710716007;return (fun_573300145710716007 = function (event) {
return (function () {
var now;return _this14.interval < _this14.constructor.getPrecision() * 2 ? (function () {
return _this14.stop();
})() : (function () {
now = new Date();_this14.targetTime = _this14.skipsPast ? (function () {
return now - (now - event.idealTime) % _this14.interval + _this14.interval;
})() : (function () {
return dotDotCalc_573300145710716007(dotDot_573300145710716007, event.idealTime, "add", [_this14.interval]);
})();!_this14[var_573300145710716007_12] ? (function () {
_this14[var_573300145710716007_12] = true;!_this14.includesStart ? (function () {
_this14.resetCounter();event.blocksListeners = true;
})() : undefined;return _this14.onStart.fire();
})() : undefined;return (_this14.includesEnd ? (function () {
return _this14.targetTime > _this14.endTime;
})() : (function () {
return _this14.targetTime >= _this14.endTime;
})()) ? (function () {
return _this14.stop();
})() : undefined;
})();
})();
})(event);
});
})();
})(options);
}
return class_573300145710716007;
})(Timer);return class_573300145710716007;
})();exports.Observer = Observer = (function () {
var var_573300145710716007_13 = Symbol();var var_573300145710716007_14 = Symbol();var var_573300145710716007_15 = Symbol();var class_573300145710716007 = (function (_IntervalTimer) {
_inherits(class_573300145710716007, _IntervalTimer);
function class_573300145710716007(args) {
var _this15 = this,
_arguments11 = arguments;
_classCallCheck(this, class_573300145710716007);
var fun_573300145710716007;(fun_573300145710716007 = function () {
for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
return (function () {
var options, fn, clonedOptions;
var _ref = args[0] instanceof Function ? (function () {
return [args[1], args[0]];
})() : (function () {
return [args[0], args[1]];
})();
var _ref2 = _slicedToArray(_ref, 2);
options = _ref2[0];
fn = _ref2[1];
clonedOptions = ok_573300145710716007(options) ? (function () {
return dotDotCalc_573300145710716007(dotDot_573300145710716007, Object, "clone", [options]);
})() : (function () {
return {};
})();var base_573300145710716007 = clonedOptions;if (base_573300145710716007.interval === undefined || base_573300145710716007.interval === null) {
base_573300145710716007.interval = 100;
};var base_573300145710716007 = clonedOptions;if (base_573300145710716007.skipsPast === undefined || base_573300145710716007.skipsPast === null) {
base_573300145710716007.skipsPast = true;
};_get(Object.getPrototypeOf(class_573300145710716007.prototype), "constructor", _this15).call(_this15, clonedOptions);_this15[var_573300145710716007_14] = fn;_this15.onChange = eventField();_this15.onUpdate = eventField();return _this15.onArrive.bind(function () {
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments11;return (function () {
var newValue;newValue = (function () {
try {
return (function () {
return _this15[var_573300145710716007_14]();
})();
} catch (catch_573300145710716007) {
return (function () {
return _this15.constructor[var_573300145710716007_13];
})();
} finally {}
})();newValue === undefined ? (function () {
newValue = _this15.constructor[var_573300145710716007_13];
})() : undefined;return _this15[var_573300145710716007_15] === undefined || !Object.is(newValue, _this15[var_573300145710716007_15]) ? (function () {
_this15.onUpdate.fire({ value: newValue });_this15[var_573300145710716007_15] !== undefined ? (function () {
return _this15.onChange.fire({ oldValue: _this15[var_573300145710716007_15], newValue: newValue });
})() : undefined;_this15[var_573300145710716007_15] = newValue;
})() : undefined;
})();
})();
});
})();
})(args);
}
return class_573300145710716007;
})(IntervalTimer);class_573300145710716007[var_573300145710716007_13] = new Error();return class_573300145710716007;
})();exports.Point = Point = (function () {
var class_573300145710716007 = (function () {
function class_573300145710716007(x, y) {
var _this16 = this;
_classCallCheck(this, class_573300145710716007);
var fun_573300145710716007;return (fun_573300145710716007 = function (x, y) {
return (function () {
_this16.x = x;_this16.y = y;
})();
})(x, y);
}
_createClass(class_573300145710716007, [{
key: "real",
value: function real() {
var _arguments12 = arguments,
_this17 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments12;return (function () {
return _this17.x;
})();
})();
}
}, {
key: "imaginary",
value: function imaginary() {
var _arguments13 = arguments,
_this18 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments13;return (function () {
return _this18.y;
})();
})();
}
}, {
key: "toString",
value: function toString() {
var _arguments14 = arguments,
_this19 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments14;return (function () {
return "(" + _this19.x + "," + _this19.y + ")";
})();
})();
}
}, {
key: "toComplexString",
value: function toComplexString() {
var _arguments15 = arguments,
_this20 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments15;return (function () {
var sign;sign = _this20.y >= 0 ? (function () {
return "+";
})() : (function () {
return "-";
})();return "" + _this20.x + "" + sign + "" + Math.abs(_this20.y) + "i";
})();
})();
}
}, {
key: "toArray",
value: function toArray() {
var _arguments16 = arguments,
_this21 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments16;return (function () {
return [_this21.x, _this21.y];
})();
})();
}
}, {
key: "clone",
value: function clone() {
var _arguments17 = arguments,
_this22 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments17;return (function () {
return new Point(_this22.x, _this22.y);
})();
})();
}
}, {
key: "equals",
value: function equals(p) {
var _this23 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function (p) {
return (function () {
return cmath.equals(_this23, p);
})();
})(p);
}
}, {
key: "approxEquals",
value: function approxEquals(p) {
var _this24 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function (p) {
return (function () {
return cmath.approxEquals(_this24, p);
})();
})(p);
}
}, {
key: "opposite",
value: function opposite() {
var _arguments18 = arguments,
_this25 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments18;return (function () {
return cmath.opposite(_this25);
})();
})();
}
}, {
key: "reciprocal",
value: function reciprocal() {
var _arguments19 = arguments,
_this26 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments19;return (function () {
return cmath.reciprocal(_this26);
})();
})();
}
}, {
key: "conjugate",
value: function conjugate() {
var _arguments20 = arguments,
_this27 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments20;return (function () {
return cmath.conjugate(_this27);
})();
})();
}
}, {
key: "abs",
value: function abs() {
var _arguments21 = arguments,
_this28 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments21;return (function () {
return cmath.abs(_this28);
})();
})();
}
}, {
key: "add",
value: function add(p) {
var _this29 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function (p) {
return (function () {
return cmath.add(_this29, p);
})();
})(p);
}
}, {
key: "subtract",
value: function subtract(p) {
var _this30 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function (p) {
return (function () {
return cmath.subtract(_this30, p);
})();
})(p);
}
}, {
key: "multiply",
value: function multiply(p) {
var _this31 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function (p) {
return (function () {
return cmath.multiply(_this31, p);
})();
})(p);
}
}, {
key: "divide",
value: function divide(p) {
var _this32 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function (p) {
return (function () {
return cmath.divide(_this32, p);
})();
})(p);
}
}, {
key: "distance",
value: function distance(p) {
var _this33 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function (p) {
return (function () {
return cmath.distance(_this33, p);
})();
})(p);
}
}, {
key: "dotProduct",
value: function dotProduct(p) {
var _this34 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function (p) {
return (function () {
p = Point.from(p);return _this34.x * p.x + _this34.y * p.y;
})();
})(p);
}
}, {
key: "crossProduct",
value: function crossProduct(p) {
var _this35 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function (p) {
return (function () {
p = Point.from(p);return _this35.x * p.y - _this35.y * p.x;
})();
})(p);
}
}, {
key: "isOppositeTo",
value: function isOppositeTo(p) {
var _this36 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function (p) {
return (function () {
return _this36.opposite().equals(p);
})();
})(p);
}
}, {
key: "phase",
value: function phase() {
var _arguments22 = arguments,
_this37 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments22;return (function () {
return cmath.phase(_this37);
})();
})();
}
}, {
key: "phaseTo",
value: function phaseTo(p) {
var _this38 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function (p) {
return (function () {
p = Point.from(p);return dotDotCalc_573300145710716007(dotDot_573300145710716007, Math, "principalRadians", [p.phase() - _this38.phase()]);
})();
})(p);
}
}, {
key: "phaseInDegrees",
value: function phaseInDegrees() {
var _arguments23 = arguments,
_this39 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function () {
var arg_573300145710716007 = _arguments23;return (function () {
return cmath.phaseInDegrees(_this39);
})();
})();
}
}, {
key: "phaseInDegreesTo",
value: function phaseInDegreesTo(p) {
var _this40 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function (p) {
return (function () {
p = Point.from(p);return dotDotCalc_573300145710716007(dotDot_573300145710716007, Math, "principalDegrees", [p.phaseInDegrees() - _this40.phaseInDegrees()]);
})();
})(p);
}
}, {
key: "scale",
value: function scale(value, second) {
var _this41 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function (value, second) {
return (function () {
var size;size = typeof value === "number" ? (function () {
return typeof second === "number" ? (function () {
return new Point(value, second);
})() : (function () {
return new Point(value, value);
})();
})() : (function () {
return Point.from(value);
})();return new Point(_this41.x * size.x, _this41.y * size.y);
})();
})(value, second);
}
}, {
key: "rotate",
value: function rotate(angle) {
var _this42 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function (angle) {
return (function () {
return _this42.multiply(Point.fromPolar(1, angle));
})();
})(angle);
}
}, {
key: "rotateDegrees",
value: function rotateDegrees(angle) {
var _this43 = this;
var fun_573300145710716007;return (fun_573300145710716007 = function (angle) {
return (function () {
return _this43.multiply(Point.fromPolarInDegrees(1, angle));
})();
})(angle);
}
}], [{
key: "from",
value: function from(value, second) {
var fun_573300145710716007;return (fun_573300145710716007 = function (value, second) {
return (function () {
return typeof value === "number" ? (function () {
return typeof second === "number" ? (function () {
return new Point(value, second);
})() : (function () {
return new Point(value, 0);
})();
})() : (function () {
return value instanceof Point ? (function () {
return value.clone();
})() : (function () {
return typeof value === "string" ? (function () {
return Point.fromString(value);
})() : (function () {
return value instanceof Array ? (function () {
return Point.fromArray(value);
})() : (function () {
return fail();
})();
})();
})();
})();
})();
})(value, second);
}
}, {
key: "fromArray",
value: function fromArray(array) {
var fun_573300145710716007;return (fun_573300145710716007 = function (array) {
return (function () {
return new Point(array[0], array[1]);
})();
})(array);
}
}, {
key: "fromString",
value: function fromString(s) {
var fun_573300145710716007;return (fun_573300145710716007 = function (s) {
return (function () {
var adjustedString, normalMatch, complexMatch, real, imaginary;adjustedString = s.replace(new RegExp("[ ()] ", "g"), "");normalMatch = adjustedString.match(new RegExp("^([^,]*),(.*)$"));return ok_573300145710716007(normalMatch) ? (function () {
return new Point(dotDotCalc_573300145710716007(dotDot_573300145710716007, Number, "parseFloat", [normalMatch[1]]), dotDotCalc_573300145710716007(dotDot_573300145710716007, Number, "parseFloat", [normalMatch[2]]));
})() : (function () {
complexMatch = adjustedString.match(formattedRegex_573300145710716007("^\n (\n [+-]?\n [0-9]*\n \\.?\n [0-9]*\n (?:\n [Ee]\n [+-]?\n [0-9]+\n )?\n (?! [i0-9Ee.] )\n )?\n (?:\n (\n [+-]?\n [0-9]*\n \\.?\n [0-9]*\n (?:\n [Ee]\n [+-]?\n [0-9]+\n )?\n )\n i\n )?\n$"));return ok_573300145710716007(complexMatch) ? (function () {
real = ifnull_573300145710716007(complexMatch[1], "0");imaginary = ifnull_573300145710716007(complexMatch[2], "0");real === "" ? (function () {
real = "1";
})() : undefined;imaginary === "" ? (function () {
imaginary = "1";
})() : undefined;real === "+" ? (function () {
real = "1";
})() : undefined;imaginary === "+" ? (function () {
imaginary = "1";
})() : undefined;real === "-" ? (function () {
real = "-1";
})() : undefined;imaginary === "-" ? (function () {
imaginary = "-1";
})() : undefined;return new Point(parseFloat(real), parseFloat(imaginary));
})() : (function () {
return fail();
})();
})();
})();
})(s);
}
}, {
key: "fromPolar",
value: function fromPolar(r, angle) {
var fun_573300145710716007;return (fun_573300145710716007 = function (r, angle) {
return (function () {
return new Point(r * Math.cos(angle), r * Math.sin(angle));
})();
})(r, angle);
}
}, {
key: "fromPolarInDegrees",
value: function fromPolarInDegrees(r, angle) {
var fun_573300145710716007;return (fun_573300145710716007 = function (r, angle) {
return (function () {
return (function () {
var matchComparer_573300145710716007 = dotDotCalc_573300145710716007(dotDot_573300145710716007, Math, "principalDegrees", [angle]);return matchComparer_573300145710716007 === 0 ? (function () {
return new Point(r, 0);
})() : matchComparer_573300145710716007 === 90 ? (function () {
return new Point(0, r);
})() : matchComparer_573300145710716007 === -90 ? (function () {
return new Point(0, -r);
})() : matchComparer_573300145710716007 === 180 ? (function () {
return new Point(-r, 0);
})() : (function () {
return Point.fromPolar(r, dotDotCalc_573300145710716007(dotDot_573300145710716007, Math, "degreesToRadians", [angle]));
})();
})();
})();
})(r, angle);
}
}]);
return class_573300145710716007;
})();return class_573300145710716007;
})();exports.sys = sys;
exports.web = web;
exports.cmath = cmath;
exports.feNumber = feNumber;
exports.feNumberStatic = feNumberStatic;
exports.feString = feString;
exports.feObject = feObject;
exports.feArray = feArray;
exports.feMath = feMath;
exports.feJson = feJson;
exports.feDate = feDate;
exports.feConsole = feConsole;
exports.dotDot_573300145710716007 = dotDot_573300145710716007 = function fun_573300145710716007(x) {
return (function () {
return typeof x === "string" ? (function () {
return feString;
return x === Number ? (function () {
return feNumberStatic;
})() : (function () {
return x instanceof Array ? (function () {
return feArray;
})() : undefined;
return x === Object ? (function () {
return feObject;
})() : (function () {
return x === Math ? (function () {
return feMath;
})() : (function () {
return x === JSON ? (function () {
return feJson;
})() : (function () {
return x === console ? (function () {
return feConsole;
})() : (function () {
return typeof x === "number" ? (function () {
return feNumber;
})() : (function () {
return typeof x === "string" ? (function () {
return feString;
})() : (function () {
return x instanceof Array ? (function () {
return feArray;
})() : (function () {
return x instanceof Date ? (function () {
return feDate;
})() : undefined;
})();
})();
})();
})();
})();
})();
})();
})();

@@ -242,2 +1038,8 @@ })();

exports.eventField = eventField;
exports.setImmediate = setImmediate;
exports.clearImmediate = clearImmediate;
exports.Timer = Timer;
exports.IntervalTimer = IntervalTimer;
exports.Observer = Observer;
exports.Point = Point;
exports.dotDot_573300145710716007 = dotDot_573300145710716007;

@@ -9,7 +9,9 @@ "use strict";Object.defineProperty(exports, "__esModule", {

var dotDotCalc_573300145710716007 = function dotDotCalc_573300145710716007(dotDot, a, b, c) {
var ok_573300145710716007 = function ok_573300145710716007(a) {
return a !== undefined && a !== null;
};var dotDotCalc_573300145710716007 = function dotDotCalc_573300145710716007(dotDot, a, b, c) {
var _dotDot;
return (_dotDot = dotDot(a))[b].apply(_dotDot, [a].concat(_toConsumableArray(c)));
};var deepSplit, stripTrailingNewline, ensureTrailingNewline;exports.deepSplit = deepSplit = function fun_573300145710716007(str) {
};var format, insert, remove, matches, capitalize, split, stripTrailingNewline, ensureTrailingNewline;exports.format = format = function fun_573300145710716007(str) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {

@@ -20,2 +22,56 @@ args[_key - 1] = arguments[_key];

return (function () {
var s, m, i;s = str.valueOf();m = [];i = 0;(0, _main.loop)(function () {
return (function () {
var cur, next;return i < s.length ? (function () {
cur = s[i];next = s[i + 1];cur === "{" && next === "{" ? (function () {
m.push("{", "");i = i + 1;
})() : (function () {
return cur === "}" && next === "}" ? (function () {
m.push("}", "");i = i + 1;
})() : (function () {
return cur === "{" && next >= "0" && next <= "9" && s[i + 2] === "}" ? (function () {
m.push(args[parseInt(next, 10)].toString(), "", "");i = i + 2;
})() : (function () {
return m.push(cur);
})();
})();
})();i = i + 1;
})() : (function () {
return _main["break"];
})();
})();
});return m.join("");
})();
};exports.insert = insert = function fun_573300145710716007(str, index, value) {
return (function () {
var s;s = str.valueOf();return s.substr(0, index) + value + s.substr(index);
})();
};exports.remove = remove = function fun_573300145710716007(str, start, length) {
if (length === undefined) {
length = 1;
}return (function () {
var s;s = str.valueOf();return s.substr(0, start) + s.substr(start + length);
})();
};exports.matches = matches = function fun_573300145710716007(str, regex) {
return (function () {
var adjustedRegex, result;adjustedRegex = new RegExp(regex.source, "g");result = [];(0, _main.loop)(function () {
return (function () {
var theMatch;theMatch = adjustedRegex.exec(str.valueOf());return ok_573300145710716007(theMatch) ? (function () {
return result.push(theMatch);
})() : (function () {
return _main["break"];
})();
})();
});return result;
})();
};exports.capitalize = capitalize = function fun_573300145710716007(str) {
return (function () {
return str.charAt(0).toUpperCase() + str.substr(1);
})();
};exports.split = split = function fun_573300145710716007(str) {
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
return (function () {
var arr;args[0] instanceof Array ? (function () {

@@ -28,3 +84,3 @@ args = args[0];

return args[1] <= arr.length - 2 ? (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "portion", [[0, args[1] - 1]]).concat([dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "portion", [args[1]]).join(args[0])]);
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "portion", [0, args[1] - 1]).concat([dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, arr, "portion", [args[1]]).join(args[0])]);
})() : (function () {

@@ -40,3 +96,3 @@ return arr;

return (function () {
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, s, "deepSplit", [dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, args, "portion", [1])]);
return dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, s, "split", [dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, args, "portion", [1])]);
})();

@@ -67,4 +123,9 @@ });

})();
};exports.deepSplit = deepSplit;
};exports.format = format;
exports.insert = insert;
exports.remove = remove;
exports.matches = matches;
exports.capitalize = capitalize;
exports.split = split;
exports.stripTrailingNewline = stripTrailingNewline;
exports.ensureTrailingNewline = ensureTrailingNewline;

@@ -5,4 +5,2 @@ "use strict";Object.defineProperty(exports, "__esModule", {

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"); } }; })();
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }

@@ -58,3 +56,3 @@

var arg_573300145710716007 = arguments;return (function () {
var response;response = { statusCode: xhr.status, statusReason: xhr.statusText, headerFields: dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, xhr.getAllResponseHeaders(), "stripTrailingNewline", []), "deepSplit", [["\r\n", ": ", 1]]).map(function fun_573300145710716007(field) {
var response;response = { statusCode: xhr.status, statusReason: xhr.statusText, headerFields: dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, dotDotCalc_573300145710716007(_main.dotDot_573300145710716007, xhr.getAllResponseHeaders(), "stripTrailingNewline", []), "split", ["\r\n", ": ", 1]).map(function fun_573300145710716007(field) {
return (function () {

@@ -153,56 +151,19 @@ return [field[0].toLowerCase(), field[1]];

return (function () {
var actualOptions;uri instanceof Array ? (function () {
var _uri = uri;
var _uri2 = _slicedToArray(_uri, 2);
uri = _uri2[0];
options = _uri2[1];
})() : undefined;actualOptions = { method: "GET", uri: uri };Object.assign(actualOptions, options);return _main.web.request(actualOptions);
var actualOptions;actualOptions = { method: "GET", uri: uri };Object.assign(actualOptions, options);return _main.web.request(actualOptions);
})();
};exports.jsonGet = jsonGet = function fun_573300145710716007(uri, options) {
return (function () {
var actualOptions;uri instanceof Array ? (function () {
var _uri3 = uri;
var _uri32 = _slicedToArray(_uri3, 2);
uri = _uri32[0];
options = _uri32[1];
})() : undefined;actualOptions = { method: "GET", uri: uri, responseBodyType: "json" };Object.assign(actualOptions, options);return _main.web.request(actualOptions);
var actualOptions;actualOptions = { method: "GET", uri: uri, responseBodyType: "json" };Object.assign(actualOptions, options);return _main.web.request(actualOptions);
})();
};exports.binaryGet = binaryGet = function fun_573300145710716007(uri, options) {
return (function () {
var actualOptions;uri instanceof Array ? (function () {
var _uri4 = uri;
var _uri42 = _slicedToArray(_uri4, 2);
uri = _uri42[0];
options = _uri42[1];
})() : undefined;actualOptions = { method: "GET", uri: uri, responseBodyType: "binary" };Object.assign(actualOptions, options);return _main.web.request(actualOptions);
var actualOptions;actualOptions = { method: "GET", uri: uri, responseBodyType: "binary" };Object.assign(actualOptions, options);return _main.web.request(actualOptions);
})();
};exports.post = post = function fun_573300145710716007(uri, body, options) {
return (function () {
var actualOptions;uri instanceof Array ? (function () {
var _uri5 = uri;
var _uri52 = _slicedToArray(_uri5, 3);
uri = _uri52[0];
body = _uri52[1];
options = _uri52[2];
})() : undefined;actualOptions = { method: "POST", uri: uri, body: body };Object.assign(actualOptions, options);return _main.web.request(actualOptions);
var actualOptions;actualOptions = { method: "POST", uri: uri, body: body };Object.assign(actualOptions, options);return _main.web.request(actualOptions);
})();
};exports.jsonPost = jsonPost = function fun_573300145710716007(uri, body, options) {
return (function () {
var actualOptions;uri instanceof Array ? (function () {
var _uri6 = uri;
var _uri62 = _slicedToArray(_uri6, 3);
uri = _uri62[0];
body = _uri62[1];
options = _uri62[2];
})() : undefined;actualOptions = { method: "POST", uri: uri, headerFields: _defineProperty({}, "Content-Type", "application/json"), body: JSON.stringify(body), responseBodyType: "json" };Object.assign(actualOptions, options);return _main.web.request(actualOptions);
var actualOptions;actualOptions = { method: "POST", uri: uri, headerFields: _defineProperty({}, "Content-Type", "application/json"), body: JSON.stringify(body), responseBodyType: "json" };Object.assign(actualOptions, options);return _main.web.request(actualOptions);
})();

@@ -209,0 +170,0 @@ };exports.request = request;

@@ -7,3 +7,5 @@ "use strict";Object.defineProperty(exports, "__esModule", {

var global;exports.loop = _targetMain.loop;
var var_573300145710716007_2;var var_573300145710716007_3;var ifvoid_573300145710716007 = function ifvoid_573300145710716007(a, b) {
return a === undefined ? b : a;
};var global;exports.loop = _targetMain.loop;
exports.repeat = _targetMain.repeat;

@@ -17,7 +19,21 @@ exports["break"] = _targetMain["break"];

exports.eventField = _targetMain.eventField;
exports.setImmediate = var_573300145710716007_2 = ifvoid_573300145710716007(_targetMain.sys.global.setImmediate, _targetMain.setImmediate);exports.clearImmediate = var_573300145710716007_3 = ifvoid_573300145710716007(_targetMain.sys.global.clearImmediate, _targetMain.clearImmediate);exports.Timer = _targetMain.Timer;
exports.IntervalTimer = _targetMain.IntervalTimer;
exports.Observer = _targetMain.Observer;
exports.Point = _targetMain.Point;
exports.sys = _targetMain.sys;
exports.web = _targetMain.web;
exports.cmath = _targetMain.cmath;
exports.feNumber = _targetMain.feNumber;
exports.feNumberStatic = _targetMain.feNumberStatic;
exports.feString = _targetMain.feString;
exports.feObject = _targetMain.feObject;
exports.feArray = _targetMain.feArray;
exports.feMath = _targetMain.feMath;
exports.feJson = _targetMain.feJson;
exports.feDate = _targetMain.feDate;
exports.feConsole = _targetMain.feConsole;
exports.dotDot_573300145710716007 = _targetMain.dotDot_573300145710716007;
exports.global = global = _targetMain.sys.global;exports.global = global;
exports.global = global = _targetMain.sys.global;exports.setImmediate = var_573300145710716007_2;
exports.clearImmediate = var_573300145710716007_3;
exports.global = global;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc