const require_nodeType = require('../types/dist/esm/nodeType.cjs');
const require_isValidReactElement = require('../utils/isValidReactElement.cjs');

//#region ../@intlayer/cli/dist/esm/chokidar/dist/esm/core/dist/esm/dictionaryManipulator/getNodeType.mjs
/**
* Type guard to check if content is a TypedNode
*/
const isTypedNode = (content) => {
	return typeof content === "object" && content !== null && "nodeType" in content && typeof content.nodeType === "string";
};
/**
* Type guard to check if content is a valid NodeType
*/
const isValidNodeType = (nodeType) => {
	return Object.values(require_nodeType.NodeType).includes(nodeType);
};
const getNodeType = (content) => {
	if (typeof content === "string") return require_nodeType.NodeType.Text;
	if (isTypedNode(content)) {
		const nodeType = content.nodeType;
		if (isValidNodeType(nodeType)) return nodeType;
		return require_nodeType.NodeType.Unknown;
	}
	if (Array.isArray(content)) return require_nodeType.NodeType.Array;
	if (require_isValidReactElement.isValidElement(content)) return require_nodeType.NodeType.ReactNode;
	if (typeof content === "number") return require_nodeType.NodeType.Number;
	if (typeof content === "boolean") return require_nodeType.NodeType.Boolean;
	if (content && typeof content === "object") return require_nodeType.NodeType.Object;
	if (content === null) return require_nodeType.NodeType.Null;
	return require_nodeType.NodeType.Unknown;
};

//#endregion
exports.getNodeType = getNodeType;
//# sourceMappingURL=getNodeType.cjs.map