UNPKG

350 BJavaScriptView Raw
1"use strict";
2
3exports.__esModule = true;
4exports.default = clear;
5
6/**
7 * Removes all child nodes from a given node.
8 *
9 * @param node the node to clear
10 */
11function clear(node) {
12 if (node) {
13 while (node.firstChild) {
14 node.removeChild(node.firstChild);
15 }
16
17 return node;
18 }
19
20 return null;
21}
22
23module.exports = exports["default"];
\No newline at end of file