data-joint
Advanced tools
Comparing version
'use strict'; | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var indexBy = require('index-array-by'); | ||
var indexBy = _interopDefault(require('index-array-by')); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
var indexBy__default = /*#__PURE__*/_interopDefaultLegacy(indexBy); | ||
return obj; | ||
} | ||
function ownKeys(object, enumerableOnly) { | ||
@@ -27,5 +14,9 @@ var keys = Object.keys(object); | ||
var symbols = Object.getOwnPropertySymbols(object); | ||
if (enumerableOnly) symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
if (enumerableOnly) { | ||
symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
} | ||
keys.push.apply(keys, symbols); | ||
@@ -57,2 +48,17 @@ } | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
@@ -95,15 +101,11 @@ if (source == null) return {}; | ||
function _slicedToArray(arr, i) { | ||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); | ||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); | ||
} | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) { | ||
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
@@ -116,17 +118,17 @@ | ||
function _iterableToArray(iter) { | ||
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _iterableToArrayLimit(arr, i) { | ||
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { | ||
return; | ||
} | ||
var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); | ||
if (_i == null) return; | ||
var _arr = []; | ||
var _n = true; | ||
var _d = false; | ||
var _e = undefined; | ||
var _s, _e; | ||
try { | ||
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { | ||
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { | ||
_arr.push(_s.value); | ||
@@ -150,8 +152,25 @@ | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance"); | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _nonIterableRest() { | ||
throw new TypeError("Invalid attempt to destructure non-iterable instance"); | ||
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
@@ -176,4 +195,4 @@ | ||
// compare by id (duplicate keys are ignored) | ||
var prevById = indexBy(prev, idAccessor, false); | ||
var nextById = indexBy(next, idAccessor, false); | ||
var prevById = indexBy__default['default'](prev, idAccessor, false); | ||
var nextById = indexBy__default['default'](next, idAccessor, false); | ||
var byId = Object.assign({}, prevById, nextById); | ||
@@ -180,0 +199,0 @@ Object.entries(byId).forEach(function (_ref) { |
@@ -1,23 +0,8 @@ | ||
// Version 1.2.3 data-joint - https://github.com/vasturiano/data-joint | ||
// Version 1.2.4 data-joint - https://github.com/vasturiano/data-joint | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global = global || self, global.dataJoint = factory()); | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.dataJoint = factory()); | ||
}(this, (function () { 'use strict'; | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function ownKeys(object, enumerableOnly) { | ||
@@ -28,5 +13,9 @@ var keys = Object.keys(object); | ||
var symbols = Object.getOwnPropertySymbols(object); | ||
if (enumerableOnly) symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
if (enumerableOnly) { | ||
symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
} | ||
keys.push.apply(keys, symbols); | ||
@@ -58,3 +47,18 @@ } | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _objectWithoutPropertiesLoose$1(source, excluded) { | ||
if (source == null) return {}; | ||
@@ -74,6 +78,6 @@ var target = {}; | ||
function _objectWithoutProperties(source, excluded) { | ||
function _objectWithoutProperties$1(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
var target = _objectWithoutPropertiesLoose$1(source, excluded); | ||
@@ -96,38 +100,34 @@ var key, i; | ||
function _slicedToArray(arr, i) { | ||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); | ||
function _slicedToArray$1(arr, i) { | ||
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1(); | ||
} | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); | ||
function _toConsumableArray$1(arr) { | ||
return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1(); | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) { | ||
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _arrayWithoutHoles$1(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray$1(arr); | ||
} | ||
function _arrayWithHoles(arr) { | ||
function _arrayWithHoles$1(arr) { | ||
if (Array.isArray(arr)) return arr; | ||
} | ||
function _iterableToArray(iter) { | ||
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); | ||
function _iterableToArray$1(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _iterableToArrayLimit(arr, i) { | ||
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { | ||
return; | ||
} | ||
function _iterableToArrayLimit$1(arr, i) { | ||
var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); | ||
if (_i == null) return; | ||
var _arr = []; | ||
var _n = true; | ||
var _d = false; | ||
var _e = undefined; | ||
var _s, _e; | ||
try { | ||
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { | ||
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { | ||
_arr.push(_s.value); | ||
@@ -151,11 +151,28 @@ | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance"); | ||
function _unsupportedIterableToArray$1(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); | ||
} | ||
function _nonIterableRest() { | ||
throw new TypeError("Invalid attempt to destructure non-iterable instance"); | ||
function _arrayLikeToArray$1(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _objectWithoutPropertiesLoose$1(source, excluded) { | ||
function _nonIterableSpread$1() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _nonIterableRest$1() { | ||
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
@@ -175,6 +192,6 @@ var target = {}; | ||
function _objectWithoutProperties$1(source, excluded) { | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {}; | ||
var target = _objectWithoutPropertiesLoose$1(source, excluded); | ||
var target = _objectWithoutPropertiesLoose(source, excluded); | ||
@@ -197,38 +214,34 @@ var key, i; | ||
function _slicedToArray$1(arr, i) { | ||
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _nonIterableRest$1(); | ||
function _slicedToArray(arr, i) { | ||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); | ||
} | ||
function _toConsumableArray$1(arr) { | ||
return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _nonIterableSpread$1(); | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _arrayWithoutHoles$1(arr) { | ||
if (Array.isArray(arr)) { | ||
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _arrayWithHoles$1(arr) { | ||
function _arrayWithHoles(arr) { | ||
if (Array.isArray(arr)) return arr; | ||
} | ||
function _iterableToArray$1(iter) { | ||
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); | ||
function _iterableToArray(iter) { | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _iterableToArrayLimit$1(arr, i) { | ||
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { | ||
return; | ||
} | ||
function _iterableToArrayLimit(arr, i) { | ||
var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); | ||
if (_i == null) return; | ||
var _arr = []; | ||
var _n = true; | ||
var _d = false; | ||
var _e = undefined; | ||
var _s, _e; | ||
try { | ||
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { | ||
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { | ||
_arr.push(_s.value); | ||
@@ -252,10 +265,27 @@ | ||
function _nonIterableSpread$1() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance"); | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _nonIterableRest$1() { | ||
throw new TypeError("Invalid attempt to destructure non-iterable instance"); | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _nonIterableRest() { | ||
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _toPrimitive(input, hint) { | ||
@@ -302,3 +332,3 @@ if (typeof input !== "object" || input === null) return input; | ||
propVal = _itemVal[keyAccessor], | ||
rest = _objectWithoutProperties$1(_itemVal, [keyAccessor].map(_toPropertyKey)); | ||
rest = _objectWithoutProperties(_itemVal, [keyAccessor].map(_toPropertyKey)); | ||
@@ -367,7 +397,7 @@ key = propVal; | ||
Object.entries(node).forEach(function (_ref2) { | ||
var _ref3 = _slicedToArray$1(_ref2, 2), | ||
var _ref3 = _slicedToArray(_ref2, 2), | ||
key = _ref3[0], | ||
val = _ref3[1]; | ||
return flatten(val, [].concat(_toConsumableArray$1(accKeys), [key])); | ||
return flatten(val, [].concat(_toConsumableArray(accKeys), [key])); | ||
}); | ||
@@ -398,3 +428,3 @@ } | ||
var nextSet = new Set(next); | ||
new Set([].concat(_toConsumableArray(prevSet), _toConsumableArray(nextSet))).forEach(function (item) { | ||
new Set([].concat(_toConsumableArray$1(prevSet), _toConsumableArray$1(nextSet))).forEach(function (item) { | ||
var type = !prevSet.has(item) ? 'enter' : !nextSet.has(item) ? 'exit' : 'update'; | ||
@@ -409,3 +439,3 @@ result[type].push(type === 'update' ? [item, item] : item); | ||
Object.entries(byId).forEach(function (_ref) { | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
var _ref2 = _slicedToArray$1(_ref, 2), | ||
id = _ref2[0], | ||
@@ -449,3 +479,3 @@ item = _ref2[1]; | ||
diff.update = diff.update.map(function (_ref4) { | ||
var _ref5 = _slicedToArray(_ref4, 2), | ||
var _ref5 = _slicedToArray$1(_ref4, 2), | ||
prevD = _ref5[0], | ||
@@ -484,3 +514,3 @@ nextD = _ref5[1]; | ||
dataBindAttr = _ref7$dataBindAttr === void 0 ? '__data' : _ref7$dataBindAttr, | ||
dataDiffOptions = _objectWithoutProperties(_ref7, ["createObj", "updateObj", "exitObj", "objBindAttr", "dataBindAttr"]); | ||
dataDiffOptions = _objectWithoutProperties$1(_ref7, ["createObj", "updateObj", "exitObj", "objBindAttr", "dataBindAttr"]); | ||
@@ -504,3 +534,3 @@ var _dataBindDiff = dataBindDiff(data, existingObjs, _objectSpread2({ | ||
var newObjs = createObjs(enter); | ||
var pointsData = [].concat(_toConsumableArray(enter), _toConsumableArray(update)); | ||
var pointsData = [].concat(_toConsumableArray$1(enter), _toConsumableArray$1(update)); | ||
updateObjs(pointsData); // Add new points | ||
@@ -507,0 +537,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Version 1.2.3 data-joint - https://github.com/vasturiano/data-joint | ||
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t=t||self).dataJoint=r()}(this,(function(){"use strict";function t(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function r(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function e(t,r){if(null==t)return{};var e,n,o=function(t,r){if(null==t)return{};var e,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)e=i[n],r.indexOf(e)>=0||(o[e]=t[e]);return o}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)e=i[n],r.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function n(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){if(!(Symbol.iterator in Object(t))&&"[object Arguments]"!==Object.prototype.toString.call(t))return;var e=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(e.push(a.value),!r||e.length!==r);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return e}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t){return function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r<t.length;r++)e[r]=t[r];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(t,r){if(null==t)return{};var e,n,o=function(t,r){if(null==t)return{};var e,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)e=i[n],r.indexOf(e)>=0||(o[e]=t[e]);return o}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)e=i[n],r.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function a(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){if(!(Symbol.iterator in Object(t))&&"[object Arguments]"!==Object.prototype.toString.call(t))return;var e=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(e.push(a.value),!r||e.length!==r);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return e}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function u(t){return function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r<t.length;r++)e[r]=t[r];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(t){var r=function(t,r){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==typeof r?r:String(r)}var f=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=(r instanceof Array?r.length?r:[void 0]:[r]).map((function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}})),f=t.reduce((function(t,r){var n=t,a=r;return o.forEach((function(t,r){var u,f=t.keyAccessor;if(t.isProp){var l=a,p=l[f],s=i(l,[f].map(c));u=p,a=s}else u=f(a,r);r+1<o.length?(n.hasOwnProperty(u)||(n[u]={}),n=n[u]):e?(n.hasOwnProperty(u)||(n[u]=[]),n[u].push(a)):n[u]=a})),t}),{});e instanceof Function&&function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;n===o.length?Object.keys(r).forEach((function(t){return r[t]=e(r[t])})):Object.values(r).forEach((function(r){return t(r,n+1)}))}(f);var l=f;return n&&(l=[],function t(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.length===o.length?l.push({keys:e,vals:r}):Object.entries(r).forEach((function(r){var n=a(r,2),o=n[0],i=n[1];return t(i,[].concat(u(e),[o]))}))}(f),r instanceof Array&&0===r.length&&1===l.length&&(l[0].keys=[])),l};function l(r,e,i){var a=i.objBindAttr,u=void 0===a?"__obj":a,c=i.dataBindAttr,l=void 0===c?"__data":c,p=i.idAccessor,s=i.purge,y=void 0!==s&&s,b=function(t){return t.hasOwnProperty(l)},d=e.filter((function(t){return!b(t)})),v=e.filter(b).map((function(t){return t[l]})),h=y?{enter:r,exit:v,update:[]}:function(t,r,e){var i={enter:[],update:[],exit:[]};if(e){var a=f(t,e,!1),u=f(r,e,!1),c=Object.assign({},a,u);Object.entries(c).forEach((function(t){var r=n(t,2),e=r[0],o=r[1],c=a.hasOwnProperty(e)?u.hasOwnProperty(e)?"update":"exit":"enter";i[c].push("update"===c?[a[e],u[e]]:o)}))}else{var l=new Set(t),p=new Set(r);new Set([].concat(o(l),o(p))).forEach((function(t){var r=l.has(t)?p.has(t)?"update":"exit":"enter";i[r].push("update"===r?[t,t]:t)}))}return i}(v,r,p);return h.update=h.update.map((function(t){var r=n(t,2),e=r[0],o=r[1];return e!==o&&(o[u]=e[u],o[u][l]=o),o})),h.exit=h.exit.concat(d.map((function(r){return t({},u,r)}))),h}return function(n,i,a,u,c){var f=c.createObj,p=void 0===f?function(t){return{}}:f,s=c.updateObj,y=void 0===s?function(t,r){}:s,b=c.exitObj,d=void 0===b?function(t){}:b,v=c.objBindAttr,h=void 0===v?"__obj":v,O=c.dataBindAttr,j=void 0===O?"__data":O,g=e(c,["createObj","updateObj","exitObj","objBindAttr","dataBindAttr"]),m=l(n,i,function(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(Object(o),!0).forEach((function(r){t(e,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({objBindAttr:h,dataBindAttr:j},g)),w=m.enter,A=m.update;m.exit.forEach((function(t){var r=t[h];delete t[h],d(r),u(r)}));var P=function(t){var r=[];return t.forEach((function(t){var e=p(t);e&&(e[j]=t,t[h]=e,r.push(e))})),r}(w);!function(t){t.forEach((function(t){var r=t[h];r&&(r[j]=t,y(r,t))}))}([].concat(o(w),o(A))),P.forEach(a)}})); | ||
// Version 1.2.4 data-joint - https://github.com/vasturiano/data-joint | ||
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t="undefined"!=typeof globalThis?globalThis:t||self).dataJoint=r()}(this,(function(){"use strict";function t(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function r(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function e(t,r){if(null==t)return{};var e,n,o=function(t,r){if(null==t)return{};var e,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)e=i[n],r.indexOf(e)>=0||(o[e]=t[e]);return o}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)e=i[n],r.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function n(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==e)return;var n,o,i=[],a=!0,u=!1;try{for(e=e.call(t);!(a=(n=e.next()).done)&&(i.push(n.value),!r||i.length!==r);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==e.return||e.return()}finally{if(u)throw o}}return i}(t,r)||i(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||i(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,r){if(t){if("string"==typeof t)return a(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?a(t,r):void 0}}function a(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function u(t,r){if(null==t)return{};var e,n,o=function(t,r){if(null==t)return{};var e,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)e=i[n],r.indexOf(e)>=0||(o[e]=t[e]);return o}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)e=i[n],r.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function c(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==e)return;var n,o,i=[],a=!0,u=!1;try{for(e=e.call(t);!(a=(n=e.next()).done)&&(i.push(n.value),!r||i.length!==r);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==e.return||e.return()}finally{if(u)throw o}}return i}(t,r)||l(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,r){if(t){if("string"==typeof t)return s(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?s(t,r):void 0}}function s(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function y(t){var r=function(t,r){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==typeof r?r:String(r)}var p=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=(r instanceof Array?r.length?r:[void 0]:[r]).map((function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}})),i=t.reduce((function(t,r){var n=t,i=r;return o.forEach((function(t,r){var a,c=t.keyAccessor;if(t.isProp){var f=i,l=f[c],s=u(f,[c].map(y));a=l,i=s}else a=c(i,r);r+1<o.length?(n.hasOwnProperty(a)||(n[a]={}),n=n[a]):e?(n.hasOwnProperty(a)||(n[a]=[]),n[a].push(i)):n[a]=i})),t}),{});e instanceof Function&&function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;n===o.length?Object.keys(r).forEach((function(t){return r[t]=e(r[t])})):Object.values(r).forEach((function(r){return t(r,n+1)}))}(i);var a=i;return n&&(a=[],function t(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.length===o.length?a.push({keys:e,vals:r}):Object.entries(r).forEach((function(r){var n=c(r,2),o=n[0],i=n[1];return t(i,[].concat(f(e),[o]))}))}(i),r instanceof Array&&0===r.length&&1===a.length&&(a[0].keys=[])),a};function d(t,e,i){var a=i.objBindAttr,u=void 0===a?"__obj":a,c=i.dataBindAttr,f=void 0===c?"__data":c,l=i.idAccessor,s=i.purge,y=void 0!==s&&s,d=function(t){return t.hasOwnProperty(f)},b=e.filter((function(t){return!d(t)})),v=e.filter(d).map((function(t){return t[f]})),h=y?{enter:t,exit:v,update:[]}:function(t,r,e){var i={enter:[],update:[],exit:[]};if(e){var a=p(t,e,!1),u=p(r,e,!1),c=Object.assign({},a,u);Object.entries(c).forEach((function(t){var r=n(t,2),e=r[0],o=r[1],c=a.hasOwnProperty(e)?u.hasOwnProperty(e)?"update":"exit":"enter";i[c].push("update"===c?[a[e],u[e]]:o)}))}else{var f=new Set(t),l=new Set(r);new Set([].concat(o(f),o(l))).forEach((function(t){var r=f.has(t)?l.has(t)?"update":"exit":"enter";i[r].push("update"===r?[t,t]:t)}))}return i}(v,t,l);return h.update=h.update.map((function(t){var r=n(t,2),e=r[0],o=r[1];return e!==o&&(o[u]=e[u],o[u][f]=o),o})),h.exit=h.exit.concat(b.map((function(t){return r({},u,t)}))),h}return function(n,i,a,u,c){var f=c.createObj,l=void 0===f?function(t){return{}}:f,s=c.updateObj,y=void 0===s?function(t,r){}:s,p=c.exitObj,b=void 0===p?function(t){}:p,v=c.objBindAttr,h=void 0===v?"__obj":v,m=c.dataBindAttr,O=void 0===m?"__data":m,g=e(c,["createObj","updateObj","exitObj","objBindAttr","dataBindAttr"]),j=d(n,i,function(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({objBindAttr:h,dataBindAttr:O},g)),w=j.enter,A=j.update;j.exit.forEach((function(t){var r=t[h];delete t[h],b(r),u(r)}));var S=function(t){var r=[];return t.forEach((function(t){var e=l(t);e&&(e[O]=t,t[h]=e,r.push(e))})),r}(w);!function(t){t.forEach((function(t){var r=t[h];r&&(r[O]=t,y(r,t))}))}([].concat(o(w),o(A))),S.forEach(a)}})); |
import indexBy from 'index-array-by'; | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function ownKeys(object, enumerableOnly) { | ||
@@ -23,5 +8,9 @@ var keys = Object.keys(object); | ||
var symbols = Object.getOwnPropertySymbols(object); | ||
if (enumerableOnly) symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
if (enumerableOnly) { | ||
symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
} | ||
keys.push.apply(keys, symbols); | ||
@@ -53,2 +42,17 @@ } | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
@@ -91,15 +95,11 @@ if (source == null) return {}; | ||
function _slicedToArray(arr, i) { | ||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); | ||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); | ||
} | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) { | ||
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
@@ -112,17 +112,17 @@ | ||
function _iterableToArray(iter) { | ||
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _iterableToArrayLimit(arr, i) { | ||
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { | ||
return; | ||
} | ||
var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); | ||
if (_i == null) return; | ||
var _arr = []; | ||
var _n = true; | ||
var _d = false; | ||
var _e = undefined; | ||
var _s, _e; | ||
try { | ||
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { | ||
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { | ||
_arr.push(_s.value); | ||
@@ -146,8 +146,25 @@ | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance"); | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _nonIterableRest() { | ||
throw new TypeError("Invalid attempt to destructure non-iterable instance"); | ||
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
@@ -154,0 +171,0 @@ |
{ | ||
"name": "data-joint", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "Perform data joins with any type of JS objects", | ||
@@ -40,18 +40,18 @@ "unpkg": "dist/data-joint.min.js", | ||
"dependencies": { | ||
"index-array-by": "^1.3.0" | ||
"index-array-by": "^1.3.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.8.7", | ||
"@babel/plugin-proposal-class-properties": "^7.8.3", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.8.3", | ||
"@babel/preset-env": "^7.8.7", | ||
"@rollup/plugin-commonjs": "^11.0.2", | ||
"@rollup/plugin-node-resolve": "^7.1.1", | ||
"@babel/core": "^7.14.0", | ||
"@babel/plugin-proposal-class-properties": "^7.13.0", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.13.8", | ||
"@babel/preset-env": "^7.14.1", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@rollup/plugin-commonjs": "^18.1.0", | ||
"@rollup/plugin-node-resolve": "^13.0.0", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.1.0", | ||
"rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-dts": "^1.3.0", | ||
"rollup-plugin-terser": "^5.3.0", | ||
"typescript": "^3.8.3" | ||
"rollup": "^2.47.0", | ||
"rollup-plugin-dts": "^3.0.1", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"typescript": "^4.2.4" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
78280
7.77%1138
4.31%Updated