const require_is_object = require('./type-checks/src/is-object.cjs');
const require_is_string = require('./type-checks/src/is-string.cjs');
require('./type-checks/src/index.cjs');

//#region ../../node_modules/.pnpm/@stryke+convert@0.6.38/node_modules/@stryke/convert/dist/parse-type-definition.mjs
/**
* Parse a type definition parameter into a {@link TypeDefinition} object
*
* @param param - The parameter to parse
* @returns The parsed type definition
*/
const parseTypeDefinition = (param) => {
	if (require_is_string.isString(param)) {
		if (param.includes(":")) {
			const params = param.split(":");
			if (params.length > 1 && params[0]) return {
				file: params[0],
				name: params[1]
			};
		}
		if (param.includes("#")) {
			const params = param.split("#");
			if (params.length > 1 && params[0]) return {
				file: params[0],
				name: params[1]
			};
		}
		return { file: param };
	}
	if (require_is_object.isObject(param)) return {
		file: param.file,
		name: param.name
	};
};

//#endregion
exports.parseTypeDefinition = parseTypeDefinition;