'use strict';

/**
* Allocate a buffer having a specified number of bytes.
*
* @module @stdlib/buffer/alloc-unsafe
*
* @example
* var allocUnsafe = require( '@stdlib/buffer/alloc-unsafe' );
*
* var buf = allocUnsafe( 10 );
* // returns <Buffer>
*/

// MODULES //

var hasAllocUnsafe = require( './has_alloc_unsafe.js' );


// MAIN //

var allocUnsafe;
if ( hasAllocUnsafe ) {
	allocUnsafe = require( './main.js' );
} else {
	allocUnsafe = require( './polyfill.js' );
}


// EXPORTS //

module.exports = allocUnsafe;

'use strict';

/**
* Allocate a buffer having a specified number of bytes.
*
* @module @stdlib/buffer/alloc-unsafe
*
* @example
* var allocUnsafe = require( '@stdlib/buffer/alloc-unsafe' );
*
* var buf = allocUnsafe( 10 );
* // returns <Buffer>
*/

// MODULES //

var hasAllocUnsafe = require( './has_alloc_unsafe.js' );
var main = require( './main.js' );
var polyfill = require( './polyfill.js' );


// MAIN //

var allocUnsafe;
if ( hasAllocUnsafe ) {
	allocUnsafe = main;
} else {
	allocUnsafe = polyfill;
}


// EXPORTS //

module.exports = allocUnsafe;

Refactor to avoid dynamic module resolution
Refactor to avoid dynamic module resolution
