function validate(module, file) {
		if (!module) return;

		for (const key in module) {
			if (key[0] === '_' || expected.has(key)) continue; // key is valid in this module

			const values = [...expected.values()];

			const hint =
				hint_for_supported_files(key, file?.slice(file.lastIndexOf('.'))) ??
				`valid exports are ${values.join(', ')}, or anything with a '_' prefix`;

			throw new Error(`Invalid export '${key}'${file ? ` in ${file}` : ''} (${hint})`);
		}
	}
@param {any} module
@param {string} [file]