import isArray from 'lodash/isArray';

/**
 * Shallow-equal compare of two arrays
 * @param {array} a0
 * @param {array} a1
 * @returns {boolean}
 */
export const isIdentical = (a0, a1) => {
    if (!isArray(a0) || !isArray(a1)) {
        throw new TypeError('Both of the arguments have to be an array!');
    }
    if (a0.length !== a1.length) {
        return false;
    }
    for (let i = 0; i < a1.length; i++) {
        if (a0[i] !== a1[i]) {
            return false;
        }
    }
    return true;
};

export default isIdentical;
