@danielgindi/dom-utils 1.0.5 → 1.0.6

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.
package/dist/lib.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/dom-utils 1.0.5
2
+ * @danielgindi/dom-utils 1.0.6
3
3
  * git://github.com/danielgindi/dom-utils.git
4
4
  */
5
5
  'use strict';
@@ -4117,7 +4117,7 @@ var setElementAttrs = function setElementAttrs(el, attrs) {
4117
4117
  el.innerHTML = String(value);else
4118
4118
  if (key === 'css' && 'style' in el)
4119
4119
  setCssProps(el, value);else
4120
- if (key === 'readOnly' || key === 'tabIndex' || key === 'textContent')
4120
+ if (key in el && key !== 'style')
4121
4121
  el[key] = value;else
4122
4122
  el.setAttribute(key, String(value));
4123
4123
  }
@@ -4194,13 +4194,21 @@ var next = function next(el, selector) {
4194
4194
  return null;
4195
4195
  };
4196
4196
 
4197
+ var unwrapChildren = function unwrapChildren(el) {
4198
+ var parent = el.parentNode;
4199
+ while (el.firstChild) {
4200
+ parent.insertBefore(el.firstChild, el);}
4201
+ parent.removeChild(el);
4202
+ };
4203
+
4197
4204
  var Dom = /*#__PURE__*/Object.freeze({
4198
4205
  __proto__: null,
4199
4206
  createElement: createElement,
4200
4207
  setElementAttrs: setElementAttrs,
4201
4208
  closestUntil: closestUntil,
4202
4209
  prev: prev,
4203
- next: next
4210
+ next: next,
4211
+ unwrapChildren: unwrapChildren
4204
4212
  });
4205
4213
 
4206
4214
  var es_string_replace = {};