This commit is contained in:
Julien Valverdé
2024-07-18 00:39:12 +02:00
parent ddb531a521
commit 4315d0dc52

View File

@@ -14,12 +14,12 @@ export module Identifiable {
Kind extends string, Kind extends string,
ID, ID,
>( >(
self: Identifiable<Kind, ID>,
that: Identifiable<Kind, ID>, that: Identifiable<Kind, ID>,
to: Identifiable<Kind, ID>,
): boolean { ): boolean {
// Two elements can only be equal if they both have a defined ID // Two elements can only be equal if they both have a defined ID
return Option.isSome(that.id) && Option.isSome(to.id) return Option.isSome(self.id) && Option.isSome(that.id)
? Equal.equals(that.id.value, to.id.value) ? Equal.equals(self.id.value, that.id.value)
: false : false
} }
} }