1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-28 10:40:52 +02:00
Files
BezierInfo-2/docs/js/graphics-element/lib/create.js
2020-11-06 11:32:44 -08:00

28 lines
456 B
JavaScript

import { enrich } from "./enrich.js";
const noop = () => {};
function create(tag) {
if (typeof document !== `undefined`) {
return enrich(document.createElement(tag));
}
const element = {
name: tag,
tag: tag.toUpperCase(),
append: noop,
appendChild: noop,
replaceChild: noop,
removeChild: noop,
classList: {
add: noop,
remove: noop,
},
children: [],
};
return element;
}
export { create };