Skip to content

Commit

Permalink
updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
WebReflection committed Nov 27, 2019
1 parent 85b768e commit 86df31d
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 96 deletions.
1 change: 1 addition & 0 deletions cjs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"commonjs"}
18 changes: 9 additions & 9 deletions esm.js

Large diffs are not rendered by default.

125 changes: 61 additions & 64 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,55 +94,6 @@ var hyperHTML = (function (document) {

var WeakSet$1 = self$1.WeakSet;

/*! (c) Andrea Giammarchi - ISC */
var self$2 = null ||
/* istanbul ignore next */
{};

try {
self$2.Map = Map;
} catch (Map) {
self$2.Map = function Map() {
var i = 0;
var k = [];
var v = [];
return {
"delete": function _delete(key) {
var had = contains(key);

if (had) {
k.splice(i, 1);
v.splice(i, 1);
}

return had;
},
forEach: function forEach(callback, context) {
k.forEach(function (key, i) {
callback.call(context, v[i], key, this);
}, this);
},
get: function get(key) {
return contains(key) ? v[i] : void 0;
},
has: function has(key) {
return contains(key);
},
set: function set(key, value) {
v[contains(key) ? i : k.push(key) - 1] = value;
return this;
}
};

function contains(v) {
i = k.indexOf(v);
return -1 < i;
}
};
}

var Map$1 = self$2.Map;

var iOF = [].indexOf;
var append = function append(get, parent, children, start, end, before) {
var isSelect = 'selectedIndex' in parent;
Expand Down Expand Up @@ -224,23 +175,20 @@ var hyperHTML = (function (document) {
tresh[i] = currentEnd;
}

var keymap = new Map$1();

for (var _i = currentStart; _i < currentEnd; _i++) {
keymap.set(currentNodes[_i], _i);
}
var nodes = currentNodes.slice(currentStart, currentEnd);

for (var _i2 = futureStart; _i2 < futureEnd; _i2++) {
var idxInOld = keymap.get(futureNodes[_i2]);
for (var _i = futureStart; _i < futureEnd; _i++) {
var index = nodes.indexOf(futureNodes[_i]);

if (idxInOld != null) {
if (-1 < index) {
var idxInOld = index + currentStart;
k = findK(tresh, minLen, idxInOld);
/* istanbul ignore else */

if (-1 < k) {
tresh[k] = idxInOld;
link[k] = {
newi: _i2,
newi: _i,
oldi: idxInOld,
prev: link[k - 1]
};
Expand Down Expand Up @@ -365,7 +313,7 @@ var hyperHTML = (function (document) {
};

var applyDiff = function applyDiff(diff, get, parentNode, futureNodes, futureStart, currentNodes, currentStart, currentLength, before) {
var live = new Map$1();
var live = [];
var length = diff.length;
var currentIndex = currentStart;
var i = 0;
Expand All @@ -379,7 +327,7 @@ var hyperHTML = (function (document) {

case INSERTION:
// TODO: bulk appends for sequential nodes
live.set(futureNodes[futureStart], 1);
live.push(futureNodes[futureStart]);
append(get, parentNode, futureNodes, futureStart++, futureStart, currentIndex < currentLength ? get(currentNodes[currentIndex], 0) : before);
break;

Expand All @@ -399,7 +347,7 @@ var hyperHTML = (function (document) {

case DELETION:
// TODO: bulk removes for sequential nodes
if (live.has(currentNodes[currentStart])) currentStart++;else remove(get, currentNodes, currentStart++, currentStart);
if (-1 < live.indexOf(currentNodes[currentStart])) currentStart++;else remove(get, currentNodes, currentStart++, currentStart);
break;
}
}
Expand Down Expand Up @@ -533,10 +481,10 @@ var hyperHTML = (function (document) {


/*! (c) Andrea Giammarchi - ISC */
var self$3 = null ||
var self$2 = null ||
/* istanbul ignore next */
{};
self$3.CustomEvent = typeof CustomEvent === 'function' ? CustomEvent : function (__p__) {
self$2.CustomEvent = typeof CustomEvent === 'function' ? CustomEvent : function (__p__) {
CustomEvent[__p__] = new CustomEvent('').constructor[__p__];
return CustomEvent;

Expand All @@ -547,7 +495,56 @@ var hyperHTML = (function (document) {
return e;
}
}('prototype');
var CustomEvent$1 = self$3.CustomEvent;
var CustomEvent$1 = self$2.CustomEvent;

/*! (c) Andrea Giammarchi - ISC */
var self$3 = null ||
/* istanbul ignore next */
{};

try {
self$3.Map = Map;
} catch (Map) {
self$3.Map = function Map() {
var i = 0;
var k = [];
var v = [];
return {
"delete": function _delete(key) {
var had = contains(key);

if (had) {
k.splice(i, 1);
v.splice(i, 1);
}

return had;
},
forEach: function forEach(callback, context) {
k.forEach(function (key, i) {
callback.call(context, v[i], key, this);
}, this);
},
get: function get(key) {
return contains(key) ? v[i] : void 0;
},
has: function has(key) {
return contains(key);
},
set: function set(key, value) {
v[contains(key) ? i : k.push(key) - 1] = value;
return this;
}
};

function contains(v) {
i = k.indexOf(v);
return -1 < i;
}
};
}

var Map$1 = self$3.Map;

// able to create Custom Elements like components
// including the ability to listen to connect/disconnect
Expand Down
Loading

0 comments on commit 86df31d

Please sign in to comment.