UNPKG

react-native-speedy-list

Version:

A performance focused list component for React Native.

26 lines 630 B
/** * Shallow comparator. * */ export const equals = (a, b) => { if (a === null || b === null || ["number", "string", "boolean", "undefined"].includes(typeof a) || ["number", "string", "boolean", "undefined"].includes(typeof b)) { return a === b; } const aKeys = Object.keys(a); const bKeys = Object.keys(b); if (aKeys.length !== bKeys.length) { return false; } for (const key of aKeys) { if (a[key] !== b[key]) { return false; } } return true; }; export const ObjectUtil = { equals, }; //# sourceMappingURL=index.js.map