normalizeFilter = item => {
	if (typeof item === "string") {
		const regExp = new RegExp(
			`[\\\\/]${item.replace(/[-[\]{}()*+?.\\^$|]/g, "\\$&")}([\\\\/]|$|!|\\?)`
		);
		return ident => regExp.test(/** @type {T} */ (ident));
	}
	if (item && typeof item === "object" && typeof item.test === "function") {
		return ident => item.test(ident);
	}
	if (typeof item === "boolean") {
		return () => item;
	}

	return /** @type {(value: T, ...args: EXPECTED_ANY[]) => boolean} */ (item);
}
@template {string} T
@param {string | ({ test: (value: T) => boolean }) | ((value: T, ...args: EXPECTED_ANY[]) => boolean) | boolean} item item to normalize
@returns {(value: T, ...args: EXPECTED_ANY[]) => boolean} normalize fn