import { isArrayEqualStrict } from "./isArrayEqualStrict.js";
import { is_typed_array_equals } from "./typed/is_typed_array_equals.js";

/**
 *
 * @param {number[]|Uint8Array} a
 * @param {number[]|Uint8Array} b
 * @returns {boolean}
 */
export function fastArrayEquals(a, b) {
    if (Array.isArray(a) || Array.isArray(b)) {
        // not typed array
        return isArrayEqualStrict(a, b);
    }

    // typed array, can do better
    return is_typed_array_equals(a, b);
}
