"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = arrayContainsObject;
var _ParseObject = _interopRequireDefault(require("./ParseObject"));
function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : {
    default: obj
  };
}
/**
 * @flow
 */

function arrayContainsObject(array /*: Array<any>*/, object /*: ParseObject*/) /*: boolean*/{
  if (array.indexOf(object) > -1) {
    return true;
  }
  for (let i = 0; i < array.length; i++) {
    if (array[i] instanceof _ParseObject.default && array[i].className === object.className && array[i]._getId() === object._getId()) {
      return true;
    }
  }
  return false;
}