feat: add missing v13 component methods (#7466)

Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
Suneet Tipirneni
2022-02-17 19:04:34 -05:00
committed by GitHub
parent 395a68ff49
commit f7257f0765
14 changed files with 190 additions and 76 deletions

View File

@@ -0,0 +1,14 @@
export interface Equatable<T> {
/**
* Whether or not this is equal to another structure
*/
equals: (other: T) => boolean;
}
/**
* Indicates if an object is equatable or not.
* @param maybeEquatable The object to check against
*/
export function isEquatable(maybeEquatable: unknown): maybeEquatable is Equatable<unknown> {
return maybeEquatable !== null && typeof maybeEquatable === 'object' && 'equals' in maybeEquatable;
}