function ensureText(textOrSourceCode) {
	if (typeof textOrSourceCode === "object") {
		const { hasBOM, text } = textOrSourceCode;
		const bom = hasBOM ? "\uFEFF" : "";

		return bom + text;
	}

	return String(textOrSourceCode);
}
Ensure the source code to be a string.
@param {string|SourceCode} textOrSourceCode The text or source code object.
@returns {string} The source code text.