function arrayCopyHelper(target, source, targetIndex, sourceIndex, blockSize) {
    if (sourceIndex < 0 || sourceIndex >= source.length) {
        throw new Error('sourceIndex out of bounds');
    }
    if (targetIndex < 0 || targetIndex >= target.length) {
        throw new Error('targetIndex out of bounds');
    }
    if (sourceIndex + blockSize > source.length) {
        throw new Error('source indices to be copied are outside bounds');
    }
    if (targetIndex + blockSize > target.length) {
        throw new Error('target array is too small to hold result');
    }
    for (let offset = 0; offset < blockSize; offset++) {
        target[targetIndex + offset] = source[sourceIndex + offset];
    }
}
// mimics memcpy as much as possible
mimics memcpy as much as possible
mimics memcpy as much as possible
function arrayCopyHelper(target, source, targetIndex, sourceIndex, blockSize) {
    if (sourceIndex < 0 || sourceIndex >= source.length) {
        throw new Error('sourceIndex out of bounds');
    }
    if (targetIndex < 0 || targetIndex >= target.length) {
        throw new Error('targetIndex out of bounds');
    }
    if (sourceIndex + blockSize > source.length) {
        throw new Error('source indices to be copied are outside bounds');
    }
    if (targetIndex + blockSize > target.length) {
        throw new Error('target array is too small to hold result');
    }
    for (let offset = 0; offset < blockSize; offset++) {
        target[targetIndex + offset] = source[sourceIndex + offset];
    }
}
function arrayCopyHelper ( target , source , targetIndex , sourceIndex , blockSize ) { if ( sourceIndex < 0 || sourceIndex >= source . length ) { throw new Error ( 'sourceIndex out of bounds' ) ; } if ( targetIndex < 0 || targetIndex >= target . length ) { throw new Error ( 'targetIndex out of bounds' ) ; } if ( sourceIndex + blockSize > source . length ) { throw new Error ( 'source indices to be copied are outside bounds' ) ; } if ( targetIndex + blockSize > target . length ) { throw new Error ( 'target array is too small to hold result' ) ; } for ( let offset = 0 ; offset < blockSize ; offset ++ ) { target [ targetIndex + offset ] = source [ sourceIndex + offset ] ; } }
mimics memcpy as much as possible
mimics memcpy as much as possible