function ndarray2array( buffer, shape, strides, offset, order ) {
	var i;
	if ( shape.length === 0 ) {
		return [];
	}
	for ( i = 0; i < shape.length; i++ ) {
		if ( shape[ i ] === 0 ) {
			return [];
		}
	}
	return recurse( arraylike2object( buffer ), shape, strides, offset, order, 0 ); // eslint-disable-line max-len
}
Converts an ndarray buffer to a generic array (which may include nested arrays).

@param {(ArrayLikeObject|TypedArray|Buffer)} buffer - data buffer
@param {NonNegativeIntegerArray} shape - array shape
@param {IntegerArray} strides - array strides
@param {NonNegativeInteger} offset - index offset
@param {string} order - specifies whether an array is row-major (C-style) or column-major (Fortran-style)
@returns {(EmptyArray|Array|Array<Array>)} array (which may include nested arrays)

@example
var buffer = [ 1, 2, 3, 4 ];
var shape = [ 2, 2 ];
var order = 'row-major';
var strides = [ 2, 1 ];
var offset = 0;

var out = ndarray2array( buffer, shape, strides, offset, order );
// returns [ [ 1, 2 ], [ 3, 4 ] ]