native-document 1.0.38 → 1.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -243,7 +243,7 @@ var NativeDocument = (function (exports) {
243
243
  });
244
244
 
245
245
  ObservableItem.prototype.__$isObservable = true;
246
-
246
+ const DEFAULT_OPERATIONS = {};
247
247
  const noneTrigger = function() {};
248
248
  ObservableItem.prototype.triggerFirstListener = function(operations) {
249
249
  this.$listeners[0](this.$currentValue, this.$previousValue, operations || {});
@@ -993,7 +993,7 @@ var NativeDocument = (function (exports) {
993
993
  parent.nativeInsertBefore(element, target);
994
994
  return;
995
995
  }
996
- if(isParentUniqueChild(parent) || target === anchorEnd) {
996
+ if(isParentUniqueChild(parent) && target === anchorEnd) {
997
997
  parent.append(element, target);
998
998
  return;
999
999
  }
@@ -1045,11 +1045,11 @@ var NativeDocument = (function (exports) {
1045
1045
  return;
1046
1046
  }
1047
1047
  if(isParentUniqueChild(parent)) {
1048
- parent.replaceChildren(anchorEnd, anchorEnd);
1048
+ parent.replaceChildren(anchorStart, anchorEnd);
1049
1049
  return;
1050
1050
  }
1051
1051
  let itemToRemove = anchorStart.nextSibling, tempItem;
1052
- while(itemToRemove !== anchorEnd) {
1052
+ while(itemToRemove && itemToRemove !== anchorEnd) {
1053
1053
  tempItem = itemToRemove.nextSibling;
1054
1054
  element.nativeAppendChild(itemToRemove);
1055
1055
  itemToRemove = tempItem;