import type { MaybePromise } from '../../controls/types.js'; import { _asyncIntersectWith, _syncIntersectWith } from './_intersect-with.js'; const _syncNot = boolean>(fn: T) => (...args: Parameters) => !fn(...args); const _asyncNot = MaybePromise>(fn: T) => async (...args: Parameters) => !(await fn(...args)); export const _syncDifferentWith = ( other: readonly U[] | ReadonlySet, equals: (value: T, otherValue: U) => boolean, // eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- type inference is preferred ) => _syncNot(_syncIntersectWith(other, equals)); export const _asyncDifferentWith = ( other: readonly U[] | ReadonlySet, equals: (value: T, otherValue: U) => MaybePromise, // eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- type inference is preferred ) => _asyncNot(_asyncIntersectWith(other, equals));