getSpecAtPath = (options, optionPath) => {
	let x = options[OptionSpecMode];
	const finalKey = optionPath.at(-1);
	if (!finalKey)
		throw new EvidenceError('Internal Error', [
			'optionPath ends with an invalid key',
			JSON.stringify(optionPath)
		]);

	for (const k of optionPath.slice(0, -1)) {
		x = x[k];
	}

	const out = x[OptionGetSpec]
		? x[OptionGetSpec][
				finalKey
			] /* Option is a parent, so we need to look at the parent's spec @ this value */
		: x[finalKey]; /* Option is not a parent, so we can look at it's spec directly */

	return out;
}
@param {*} options
@param {string[]} optionPath
@returns {import('../../schemas/datasourcePluginOptions.schema.js').IDatasourceOptionSpec}