mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-08-28 10:40:52 +02:00
28 lines
456 B
JavaScript
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 };
|