"use strict";
// Copyright 2017-2020 @polkadot/types authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("@polkadot/util");
// NOTE These are used internally and when comparing objects, expects that
// when the second is an Codec[] that the first has to be as well
function compareArray(a, b) {
    if (Array.isArray(b)) {
        return (a.length === b.length) && util_1.isUndefined(a.find((value, index) => util_1.isFunction(value.eq)
            ? !value.eq(b[index])
            : value !== b[index]));
    }
    return false;
}
exports.default = compareArray;
