@jsplumb/util
Advanced tools
Comparing version 5.0.0-RC4 to 5.0.0-RC40
@@ -28,5 +28,2 @@ 'use strict'; | ||
} | ||
function isArray(a) { | ||
return Array.isArray(a); | ||
} | ||
function isNumber(n) { | ||
@@ -64,10 +61,2 @@ return Object.prototype.toString.call(n) === "[object Number]"; | ||
} | ||
var IS = { | ||
anObject: function anObject(o) { | ||
return o == null ? false : Object.prototype.toString.call(o) === "[object Object]"; | ||
}, | ||
aString: function aString(o) { | ||
return isString(o); | ||
} | ||
}; | ||
function clone(a) { | ||
@@ -82,3 +71,3 @@ if (isString(a)) { | ||
return a; | ||
} else if (isArray(a)) { | ||
} else if (Array.isArray(a)) { | ||
var _b = []; | ||
@@ -89,3 +78,3 @@ for (var i = 0; i < a.length; i++) { | ||
return _b; | ||
} else if (IS.anObject(a)) { | ||
} else if (isObject(a)) { | ||
var c = {}; | ||
@@ -128,3 +117,3 @@ for (var j in a) { | ||
ar = []; | ||
ar.push.apply(ar, isArray(c[i]) ? c[i] : [c[i]]); | ||
ar.push.apply(ar, Array.isArray(c[i]) ? c[i] : [c[i]]); | ||
ar.push(b[i]); | ||
@@ -135,5 +124,5 @@ c[i] = ar; | ||
} else { | ||
if (isArray(b[i])) { | ||
if (Array.isArray(b[i])) { | ||
ar = []; | ||
if (isArray(c[i])) { | ||
if (Array.isArray(c[i])) { | ||
ar.push.apply(ar, c[i]); | ||
@@ -143,4 +132,4 @@ } | ||
c[i] = ar; | ||
} else if (IS.anObject(b[i])) { | ||
if (!IS.anObject(c[i])) { | ||
} else if (isObject(b[i])) { | ||
if (!isObject(c[i])) { | ||
c[i] = {}; | ||
@@ -223,3 +212,3 @@ } | ||
return d(values); | ||
} else if (isArray(d)) { | ||
} else if (Array.isArray(d)) { | ||
var r = []; | ||
@@ -230,3 +219,3 @@ for (var i = 0; i < d.length; i++) { | ||
return r; | ||
} else if (IS.anObject(d)) { | ||
} else if (isObject(d)) { | ||
var s = {}; | ||
@@ -263,7 +252,7 @@ for (var j in d) { | ||
} | ||
function findAllWithFunction(a, f) { | ||
function findAllWithFunction(a, predicate) { | ||
var o = []; | ||
if (a) { | ||
for (var i = 0; i < a.length; i++) { | ||
if (f(a[i])) { | ||
if (predicate(a[i])) { | ||
o.push(i); | ||
@@ -421,3 +410,3 @@ } | ||
} | ||
if ( typeof console !== "undefined") { | ||
if (typeof console !== "undefined") { | ||
try { | ||
@@ -452,11 +441,2 @@ var msg = arguments[arguments.length - 1]; | ||
} | ||
function _mergeOverrides(def, values) { | ||
var m = extend({}, def); | ||
for (var _i3 in values) { | ||
if (values[_i3]) { | ||
m[_i3] = values[_i3]; | ||
} | ||
} | ||
return m; | ||
} | ||
function getsert(map, key, valueGenerator) { | ||
@@ -568,2 +548,15 @@ if (!map.has(key)) { | ||
function _isNativeReflectConstruct() { | ||
if (typeof Reflect === "undefined" || !Reflect.construct) return false; | ||
if (Reflect.construct.sham) return false; | ||
if (typeof Proxy === "function") return true; | ||
try { | ||
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); | ||
return true; | ||
} catch (e) { | ||
return false; | ||
} | ||
} | ||
function _assertThisInitialized(self) { | ||
@@ -585,4 +578,22 @@ if (self === void 0) { | ||
var EventGenerator = | ||
function () { | ||
function _createSuper(Derived) { | ||
var hasNativeReflectConstruct = _isNativeReflectConstruct(); | ||
return function _createSuperInternal() { | ||
var Super = _getPrototypeOf(Derived), | ||
result; | ||
if (hasNativeReflectConstruct) { | ||
var NewTarget = _getPrototypeOf(this).constructor; | ||
result = Reflect.construct(Super, arguments, NewTarget); | ||
} else { | ||
result = Super.apply(this, arguments); | ||
} | ||
return _possibleConstructorReturn(this, result); | ||
}; | ||
} | ||
var EventGenerator = function () { | ||
function EventGenerator() { | ||
@@ -708,8 +719,8 @@ _classCallCheck(this, EventGenerator); | ||
}(); | ||
var OptimisticEventGenerator = | ||
function (_EventGenerator) { | ||
var OptimisticEventGenerator = function (_EventGenerator) { | ||
_inherits(OptimisticEventGenerator, _EventGenerator); | ||
var _super = _createSuper(OptimisticEventGenerator); | ||
function OptimisticEventGenerator() { | ||
_classCallCheck(this, OptimisticEventGenerator); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(OptimisticEventGenerator).apply(this, arguments)); | ||
return _super.apply(this, arguments); | ||
} | ||
@@ -904,6 +915,4 @@ _createClass(OptimisticEventGenerator, [{ | ||
exports.EventGenerator = EventGenerator; | ||
exports.IS = IS; | ||
exports.OptimisticEventGenerator = OptimisticEventGenerator; | ||
exports.TWO_PI = TWO_PI; | ||
exports._mergeOverrides = _mergeOverrides; | ||
exports.add = add; | ||
@@ -932,3 +941,2 @@ exports.addToDictionary = addToDictionary; | ||
exports.intersects = intersects; | ||
exports.isArray = isArray; | ||
exports.isAssignableFrom = isAssignableFrom; | ||
@@ -935,0 +943,0 @@ exports.isBoolean = isBoolean; |
@@ -24,5 +24,2 @@ function filterList(list, value, missingIsFalse) { | ||
} | ||
function isArray(a) { | ||
return Array.isArray(a); | ||
} | ||
function isNumber(n) { | ||
@@ -60,10 +57,2 @@ return Object.prototype.toString.call(n) === "[object Number]"; | ||
} | ||
var IS = { | ||
anObject: function anObject(o) { | ||
return o == null ? false : Object.prototype.toString.call(o) === "[object Object]"; | ||
}, | ||
aString: function aString(o) { | ||
return isString(o); | ||
} | ||
}; | ||
function clone(a) { | ||
@@ -78,3 +67,3 @@ if (isString(a)) { | ||
return a; | ||
} else if (isArray(a)) { | ||
} else if (Array.isArray(a)) { | ||
var _b = []; | ||
@@ -85,3 +74,3 @@ for (var i = 0; i < a.length; i++) { | ||
return _b; | ||
} else if (IS.anObject(a)) { | ||
} else if (isObject(a)) { | ||
var c = {}; | ||
@@ -124,3 +113,3 @@ for (var j in a) { | ||
ar = []; | ||
ar.push.apply(ar, isArray(c[i]) ? c[i] : [c[i]]); | ||
ar.push.apply(ar, Array.isArray(c[i]) ? c[i] : [c[i]]); | ||
ar.push(b[i]); | ||
@@ -131,5 +120,5 @@ c[i] = ar; | ||
} else { | ||
if (isArray(b[i])) { | ||
if (Array.isArray(b[i])) { | ||
ar = []; | ||
if (isArray(c[i])) { | ||
if (Array.isArray(c[i])) { | ||
ar.push.apply(ar, c[i]); | ||
@@ -139,4 +128,4 @@ } | ||
c[i] = ar; | ||
} else if (IS.anObject(b[i])) { | ||
if (!IS.anObject(c[i])) { | ||
} else if (isObject(b[i])) { | ||
if (!isObject(c[i])) { | ||
c[i] = {}; | ||
@@ -219,3 +208,3 @@ } | ||
return d(values); | ||
} else if (isArray(d)) { | ||
} else if (Array.isArray(d)) { | ||
var r = []; | ||
@@ -226,3 +215,3 @@ for (var i = 0; i < d.length; i++) { | ||
return r; | ||
} else if (IS.anObject(d)) { | ||
} else if (isObject(d)) { | ||
var s = {}; | ||
@@ -259,7 +248,7 @@ for (var j in d) { | ||
} | ||
function findAllWithFunction(a, f) { | ||
function findAllWithFunction(a, predicate) { | ||
var o = []; | ||
if (a) { | ||
for (var i = 0; i < a.length; i++) { | ||
if (f(a[i])) { | ||
if (predicate(a[i])) { | ||
o.push(i); | ||
@@ -417,3 +406,3 @@ } | ||
} | ||
if ( typeof console !== "undefined") { | ||
if (typeof console !== "undefined") { | ||
try { | ||
@@ -448,11 +437,2 @@ var msg = arguments[arguments.length - 1]; | ||
} | ||
function _mergeOverrides(def, values) { | ||
var m = extend({}, def); | ||
for (var _i3 in values) { | ||
if (values[_i3]) { | ||
m[_i3] = values[_i3]; | ||
} | ||
} | ||
return m; | ||
} | ||
function getsert(map, key, valueGenerator) { | ||
@@ -564,2 +544,15 @@ if (!map.has(key)) { | ||
function _isNativeReflectConstruct() { | ||
if (typeof Reflect === "undefined" || !Reflect.construct) return false; | ||
if (Reflect.construct.sham) return false; | ||
if (typeof Proxy === "function") return true; | ||
try { | ||
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); | ||
return true; | ||
} catch (e) { | ||
return false; | ||
} | ||
} | ||
function _assertThisInitialized(self) { | ||
@@ -581,4 +574,22 @@ if (self === void 0) { | ||
var EventGenerator = | ||
function () { | ||
function _createSuper(Derived) { | ||
var hasNativeReflectConstruct = _isNativeReflectConstruct(); | ||
return function _createSuperInternal() { | ||
var Super = _getPrototypeOf(Derived), | ||
result; | ||
if (hasNativeReflectConstruct) { | ||
var NewTarget = _getPrototypeOf(this).constructor; | ||
result = Reflect.construct(Super, arguments, NewTarget); | ||
} else { | ||
result = Super.apply(this, arguments); | ||
} | ||
return _possibleConstructorReturn(this, result); | ||
}; | ||
} | ||
var EventGenerator = function () { | ||
function EventGenerator() { | ||
@@ -704,8 +715,8 @@ _classCallCheck(this, EventGenerator); | ||
}(); | ||
var OptimisticEventGenerator = | ||
function (_EventGenerator) { | ||
var OptimisticEventGenerator = function (_EventGenerator) { | ||
_inherits(OptimisticEventGenerator, _EventGenerator); | ||
var _super = _createSuper(OptimisticEventGenerator); | ||
function OptimisticEventGenerator() { | ||
_classCallCheck(this, OptimisticEventGenerator); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(OptimisticEventGenerator).apply(this, arguments)); | ||
return _super.apply(this, arguments); | ||
} | ||
@@ -899,2 +910,2 @@ _createClass(OptimisticEventGenerator, [{ | ||
export { EventGenerator, IS, OptimisticEventGenerator, TWO_PI, _mergeOverrides, add, addToDictionary, addToList, addWithFunction, clone, each, encloses, extend, fastTrim, filterList, filterNull, findAllWithFunction, findWithFunction, forEach, fromArray, functionChain, getAllWithFunction, getFromSetWithFunction, getWithFunction, getsert, gradient, insertSorted, intersects, isArray, isAssignableFrom, isBoolean, isDate, isEmpty, isFunction, isNamedFunction, isNull, isNumber, isObject, isString, lineIntersection, lineLength, lineRectangleIntersection, log, logEnabled, map, merge, normal, perpendicularLineTo, pointOnLine, populate, quadrant, remove, removeWithFunction, replace, rotateAnchorOrientation, rotatePoint, setToArray, snapToGrid, sortHelper, subtract, suggest, theta, uuid, wrap }; | ||
export { EventGenerator, OptimisticEventGenerator, TWO_PI, add, addToDictionary, addToList, addWithFunction, clone, each, encloses, extend, fastTrim, filterList, filterNull, findAllWithFunction, findWithFunction, forEach, fromArray, functionChain, getAllWithFunction, getFromSetWithFunction, getWithFunction, getsert, gradient, insertSorted, intersects, isAssignableFrom, isBoolean, isDate, isEmpty, isFunction, isNamedFunction, isNull, isNumber, isObject, isString, lineIntersection, lineLength, lineRectangleIntersection, log, logEnabled, map, merge, normal, perpendicularLineTo, pointOnLine, populate, quadrant, remove, removeWithFunction, replace, rotateAnchorOrientation, rotatePoint, setToArray, snapToGrid, sortHelper, subtract, suggest, theta, uuid, wrap }; |
@@ -30,5 +30,2 @@ (function (global, factory) { | ||
} | ||
function isArray(a) { | ||
return Array.isArray(a); | ||
} | ||
function isNumber(n) { | ||
@@ -66,10 +63,2 @@ return Object.prototype.toString.call(n) === "[object Number]"; | ||
} | ||
var IS = { | ||
anObject: function anObject(o) { | ||
return o == null ? false : Object.prototype.toString.call(o) === "[object Object]"; | ||
}, | ||
aString: function aString(o) { | ||
return isString(o); | ||
} | ||
}; | ||
function clone(a) { | ||
@@ -84,3 +73,3 @@ if (isString(a)) { | ||
return a; | ||
} else if (isArray(a)) { | ||
} else if (Array.isArray(a)) { | ||
var _b = []; | ||
@@ -91,3 +80,3 @@ for (var i = 0; i < a.length; i++) { | ||
return _b; | ||
} else if (IS.anObject(a)) { | ||
} else if (isObject(a)) { | ||
var c = {}; | ||
@@ -130,3 +119,3 @@ for (var j in a) { | ||
ar = []; | ||
ar.push.apply(ar, isArray(c[i]) ? c[i] : [c[i]]); | ||
ar.push.apply(ar, Array.isArray(c[i]) ? c[i] : [c[i]]); | ||
ar.push(b[i]); | ||
@@ -137,5 +126,5 @@ c[i] = ar; | ||
} else { | ||
if (isArray(b[i])) { | ||
if (Array.isArray(b[i])) { | ||
ar = []; | ||
if (isArray(c[i])) { | ||
if (Array.isArray(c[i])) { | ||
ar.push.apply(ar, c[i]); | ||
@@ -145,4 +134,4 @@ } | ||
c[i] = ar; | ||
} else if (IS.anObject(b[i])) { | ||
if (!IS.anObject(c[i])) { | ||
} else if (isObject(b[i])) { | ||
if (!isObject(c[i])) { | ||
c[i] = {}; | ||
@@ -225,3 +214,3 @@ } | ||
return d(values); | ||
} else if (isArray(d)) { | ||
} else if (Array.isArray(d)) { | ||
var r = []; | ||
@@ -232,3 +221,3 @@ for (var i = 0; i < d.length; i++) { | ||
return r; | ||
} else if (IS.anObject(d)) { | ||
} else if (isObject(d)) { | ||
var s = {}; | ||
@@ -265,7 +254,7 @@ for (var j in d) { | ||
} | ||
function findAllWithFunction(a, f) { | ||
function findAllWithFunction(a, predicate) { | ||
var o = []; | ||
if (a) { | ||
for (var i = 0; i < a.length; i++) { | ||
if (f(a[i])) { | ||
if (predicate(a[i])) { | ||
o.push(i); | ||
@@ -423,3 +412,3 @@ } | ||
} | ||
if ( typeof console !== "undefined") { | ||
if (typeof console !== "undefined") { | ||
try { | ||
@@ -454,11 +443,2 @@ var msg = arguments[arguments.length - 1]; | ||
} | ||
function _mergeOverrides(def, values) { | ||
var m = extend({}, def); | ||
for (var _i3 in values) { | ||
if (values[_i3]) { | ||
m[_i3] = values[_i3]; | ||
} | ||
} | ||
return m; | ||
} | ||
function getsert(map, key, valueGenerator) { | ||
@@ -570,2 +550,15 @@ if (!map.has(key)) { | ||
function _isNativeReflectConstruct() { | ||
if (typeof Reflect === "undefined" || !Reflect.construct) return false; | ||
if (Reflect.construct.sham) return false; | ||
if (typeof Proxy === "function") return true; | ||
try { | ||
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); | ||
return true; | ||
} catch (e) { | ||
return false; | ||
} | ||
} | ||
function _assertThisInitialized(self) { | ||
@@ -587,4 +580,22 @@ if (self === void 0) { | ||
var EventGenerator = | ||
function () { | ||
function _createSuper(Derived) { | ||
var hasNativeReflectConstruct = _isNativeReflectConstruct(); | ||
return function _createSuperInternal() { | ||
var Super = _getPrototypeOf(Derived), | ||
result; | ||
if (hasNativeReflectConstruct) { | ||
var NewTarget = _getPrototypeOf(this).constructor; | ||
result = Reflect.construct(Super, arguments, NewTarget); | ||
} else { | ||
result = Super.apply(this, arguments); | ||
} | ||
return _possibleConstructorReturn(this, result); | ||
}; | ||
} | ||
var EventGenerator = function () { | ||
function EventGenerator() { | ||
@@ -710,8 +721,8 @@ _classCallCheck(this, EventGenerator); | ||
}(); | ||
var OptimisticEventGenerator = | ||
function (_EventGenerator) { | ||
var OptimisticEventGenerator = function (_EventGenerator) { | ||
_inherits(OptimisticEventGenerator, _EventGenerator); | ||
var _super = _createSuper(OptimisticEventGenerator); | ||
function OptimisticEventGenerator() { | ||
_classCallCheck(this, OptimisticEventGenerator); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(OptimisticEventGenerator).apply(this, arguments)); | ||
return _super.apply(this, arguments); | ||
} | ||
@@ -906,6 +917,4 @@ _createClass(OptimisticEventGenerator, [{ | ||
exports.EventGenerator = EventGenerator; | ||
exports.IS = IS; | ||
exports.OptimisticEventGenerator = OptimisticEventGenerator; | ||
exports.TWO_PI = TWO_PI; | ||
exports._mergeOverrides = _mergeOverrides; | ||
exports.add = add; | ||
@@ -934,3 +943,2 @@ exports.addToDictionary = addToDictionary; | ||
exports.intersects = intersects; | ||
exports.isArray = isArray; | ||
exports.isAssignableFrom = isAssignableFrom; | ||
@@ -937,0 +945,0 @@ exports.isBoolean = isBoolean; |
{ | ||
"name": "@jsplumb/util", | ||
"version": "5.0.0-RC4", | ||
"description": "", | ||
"main": "js/jsplumb.util.cjs.js", | ||
"module": "js/jsplumb.util.es.js", | ||
"directories": { | ||
"doc": "doc", | ||
"test": "tests" | ||
}, | ||
"files": [ | ||
"**/*.d.ts", | ||
"js/jsplumb.util.umd.js", | ||
"js/jsplumb.util.cjs.js", | ||
"js/jsplumb.util.es.js" | ||
], | ||
"types": "types/index.d.ts", | ||
"scripts": {}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/jsplumb/jsplumb.git", | ||
"directory": "ts/util" | ||
}, | ||
"keywords": [ | ||
"javascript", | ||
"svg", | ||
"visual", | ||
"connectivity" | ||
], | ||
"author": "jsPlumb (hello@jsplumbtoolkit.com)", | ||
"license": "(MIT OR GPL-2.0)", | ||
"dependencies": {}, | ||
"devDependencies": {}, | ||
"publishConfig": { | ||
"registry": "http://registry.npmjs.org" | ||
} | ||
"name": "@jsplumb/util", | ||
"version": "5.0.0-RC40", | ||
"description": "", | ||
"main": "js/jsplumb.util.cjs.js", | ||
"module": "js/jsplumb.util.es.js", | ||
"directories": { | ||
"doc": "doc", | ||
"test": "tests" | ||
}, | ||
"files": [ | ||
"util.d.ts", | ||
"js/jsplumb.util.umd.js", | ||
"js/jsplumb.util.cjs.js", | ||
"js/jsplumb.util.es.js" | ||
], | ||
"types": "util.d.ts", | ||
"scripts": {}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/jsplumb/jsplumb.git", | ||
"directory": "ts/util" | ||
}, | ||
"keywords": [ | ||
"javascript", | ||
"svg", | ||
"visual", | ||
"connectivity" | ||
], | ||
"author": "jsPlumb (hello@jsplumbtoolkit.com)", | ||
"license": "(MIT OR GPL-2.0)", | ||
"dependencies": {}, | ||
"devDependencies": {} | ||
} |
105179
3411
41588
5