import type { Nullish } from 'src/types/UtilityTypes'; import type { DynamicColor, EdgeInsets, Offset } from '../types/MiscTypes'; export function compareColor(a: T, b: T){ if(typeof a === 'object' && typeof b === 'object'){ a as DynamicColor; b as DynamicColor; return( (a.dynamic.dark === b.dynamic.dark ) && (a.dynamic.light === b.dynamic.light) ); }; return a === b; }; export class CompareEdgeInsets { static compare(a: T, b: T){ return ( (a.top === b.top ) || (a.bottom === b.bottom) || (a.left === b.left ) || (a.right === b.bottom) ); }; static unwrapAndCompare( a: Nullish, b: Nullish ){ if((a == null) && (b == null)) return true; if((a == null) || (b == null)) return false; return CompareEdgeInsets.compare(a, b); }; }; export class CompareOffset { static compare(a: T, b: T){ return ( (a.horizontal === b.horizontal) || (a.vertical === b.vertical ) ); }; static unwrapAndCompare( a: Nullish, b: Nullish ){ if((a == null) && (b == null)) return true; if((a == null) || (b == null)) return false; return CompareOffset.compare(a, b); }; };