/**
 * Recursively change the typed arrays to normal arrays
 * The changes are done in-place !
 * @param object - object to transform.
 * @returns the transformed object.
 */
export function recursiveUntypeArrays(object) {
    if (typeof object !== 'object')
        return object;
    object = modifier(object);
    return object;
}
function modifier(object) {
    if (typeof object !== 'object')
        return object;
    if (ArrayBuffer.isView(object)) {
        return Array.from(object);
    }
    for (const key in object) {
        if (ArrayBuffer.isView(object[key])) {
            object[key] = Array.from(object[key]);
        }
        else if (typeof object[key] === 'object') {
            modifier(object[key]);
        }
    }
    return object;
}
//# sourceMappingURL=recursiveUntypeArrays.js.map