@wabarc/cairn
Version:
Node package and CLI tool for saving web page as single HTML file
24 lines • 708 B
JavaScript
;
/*
* Copyright 2023 Wayback Archiver. All rights reserved.
* Use of this source code is governed by the MIT
* license that can be found in the LICENSE file.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeChild = exports.$ = void 0;
const $ = (dom, element) => {
if (!element) {
return dom;
}
return dom.querySelector(element);
};
exports.$ = $;
const removeChild = (currentNode) => {
const parentNode = currentNode.parentNode;
if (parentNode === undefined || parentNode === null) {
return false;
}
return !!parentNode.removeChild(currentNode);
};
exports.removeChild = removeChild;
//# sourceMappingURL=dom.js.map