sortByField = field => {
	if (!field) {
		/**
		 * @param {T} a first
		 * @param {T} b second
		 * @returns {-1 | 0 | 1} zero
		 */
		const noSort = (a, b) => 0;
		return noSort;
	}

	const fieldKey = normalizeFieldKey(field);

	let sortFn = compareSelect(m => m[fieldKey], compareIds);

	// if a field is prefixed with a "!" the sort is reversed!
	const sortIsRegular = sortOrderRegular(field);

	if (!sortIsRegular) {
		const oldSortFn = sortFn;
		sortFn = (a, b) => oldSortFn(b, a);
	}

	return sortFn;
}
@template T
@param {string | false} field field name
@returns {(a: T, b: T) => 0 | 1 | -1} comparators