packages/material-ui/src/Modal/ModalManager.ts/findIndexOf
function findIndexOf<T>(items: T[], callback: (item: T) => boolean): number {
  let idx = -1;
  items.some((item, index) => {
    if (callback(item)) {
      idx = index;
      return true;
    }
    return false;
  });
  return idx;
}