/**
 * Add an object to a parent object
 * @example
 * ```
  const cube = getPrefab({ p: [0, 0, 5] });
  addTo(root, cube);
 * ```
 */
export const addTo = (parent, children) => {
    let arrChildren;
    if (!Array.isArray(children)) {
        arrChildren = [children];
    }
    else {
        arrChildren = children;
    }
    for (let index = 0; index < arrChildren.length; index++) {
        const ch = arrChildren[index];
        parent.children?.push(ch);
    }
    return arrChildren[0];
};
//# sourceMappingURL=addTo.js.map