@daeinc/dom
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -1,2 +0,1 @@ | ||
"use strict"; | ||
/** | ||
@@ -7,8 +6,6 @@ * append child to parent. if parent is undefined, append child to body | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.toHTMLElement = exports.toElement = exports.appendChild = void 0; | ||
const appendChild = (parent, child) => { | ||
child = (0, exports.toElement)(child); | ||
export const appendChild = (parent, child) => { | ||
child = toElement(child); | ||
if (parent !== undefined) { | ||
parent = (0, exports.toElement)(parent); | ||
parent = toElement(parent); | ||
parent.appendChild(child); | ||
@@ -20,3 +17,2 @@ } | ||
}; | ||
exports.appendChild = appendChild; | ||
/** | ||
@@ -28,3 +24,3 @@ * convert selector (string) to Element. if already typeof Element, return as is. | ||
*/ | ||
const toElement = (selector) => { | ||
export const toElement = (selector) => { | ||
if (typeof selector === "string") { | ||
@@ -39,3 +35,2 @@ const element = document.querySelector(selector); | ||
}; | ||
exports.toElement = toElement; | ||
/** | ||
@@ -47,3 +42,3 @@ * convert selector (string) to HTMLElement. if already typeof HTMLElement, return as is. | ||
*/ | ||
const toHTMLElement = (selector) => { | ||
export const toHTMLElement = (selector) => { | ||
if (typeof selector === "string") { | ||
@@ -58,3 +53,2 @@ const element = document.querySelector(selector); | ||
}; | ||
exports.toHTMLElement = toHTMLElement; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@daeinc/dom", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "DOM utilities", | ||
@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5667
67