function wrap( flatten ) {
	return flattenArray;

	/**
	* Flattens an array and deep copies array elements.
	*
	* @private
	* @param {ArrayLikeObject} arr - array to flatten
	* @throws {TypeError} must provide an array-like object
	* @returns {Array} flattened array
	*/
	function flattenArray( arr ) {
		if ( !isArrayLikeObject( arr ) ) {
			throw new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', arr ) );
		}
		return copy( flatten( arr ) );
	}
}
Returns a function to flatten an array and deep copy.

@private
@param {Function} flatten - flatten function
@returns {Function} wrapped flatten function