function data( x ) {
	var out;

	// Note: we intentionally avoid rigorous ndarray checks to minimize performance impacts. This obviously means that non-ndarray-like objects can sneak through, but this is likely all right for the purposes of this function...
	if ( typeof x !== 'object' || x === null ) {
		throw new TypeError( format( 'invalid argument. Must provide an ndarray. Value: `%s`.', x ) );
	}
	out = x.data;
	if ( isCollection( out ) ) {
		return out;
	}
	// A data buffer is essential for operating on an ndarray object, so no fallbacks or workarounds for data buffer resolution...
	throw new TypeError( format( 'invalid argument. Must provide an ndarray. Value: `%s`.', x ) );
}
Returns the underlying data buffer of a provided ndarray.

@param {ndarrayLike} x - input ndarray
@throws {TypeError} must provide an ndarray
@returns {Collection} underlying data buffer

@example
var zeros = require( '@stdlib/ndarray/zeros' );

var x = zeros( [ 3, 3, 3 ], {
    'dtype': 'float64'
});

var out = data( x );
// returns <Float64Array>