function cover( texture, aspect ) {

	const imageAspect = ( texture.image && texture.image.width ) ? texture.image.width / texture.image.height : 1;

	if ( imageAspect > aspect ) {

		texture.repeat.x = aspect / imageAspect;
		texture.repeat.y = 1;

		texture.offset.x = ( 1 - texture.repeat.x ) / 2;
		texture.offset.y = 0;

	} else {

		texture.repeat.x = 1;
		texture.repeat.y = imageAspect / aspect;

		texture.offset.x = 0;
		texture.offset.y = ( 1 - texture.repeat.y ) / 2;

	}

	return texture;

}
Scales the texture to the smallest possible size to fill the surface, leaving
no empty space. The method preserves the original aspect ratio of the texture.
Akin to CSS `object-fit: cover`.

@param {Texture} texture - The texture.
@param {number} aspect - The texture's aspect ratio.
@return {Texture} The updated texture.