function compressUvs( geometry ) {

	const uvs = geometry.attributes.uv;

	if ( ! uvs ) {

		console.error( 'THREE.GeometryCompressionUtils.compressUvs(): Geometry must contain uv attribute.' );

	}

	if ( uvs.isPacked ) return;

	const range = { min: Infinity, max: - Infinity };

	const array = uvs.array;

	for ( let i = 0; i < array.length; i ++ ) {

		range.min = Math.min( range.min, array[ i ] );
		range.max = Math.max( range.max, array[ i ] );

	}

	let result;

	if ( range.min >= - 1.0 && range.max <= 1.0 ) {

		// use default encoding method
		result = new Uint16Array( array.length );

		for ( let i = 0; i < array.length; i += 2 ) {

			const encoded = defaultEncode( array[ i ], array[ i + 1 ], 0, 2 );

			result[ i ] = encoded[ 0 ];
			result[ i + 1 ] = encoded[ 1 ];

		}

		geometry.setAttribute( 'uv', new BufferAttribute( result, 2, true ) );
		geometry.attributes.uv.isPacked = true;
		geometry.attributes.uv.needsUpdate = true;
		geometry.attributes.uv.bytes = result.length * 2;

	} else {

		// use quantized encoding method
		result = quantizedEncodeUV( array, 2 );

		geometry.setAttribute( 'uv', new BufferAttribute( result.quantized, 2 ) );
		geometry.attributes.uv.isPacked = true;
		geometry.attributes.uv.needsUpdate = true;
		geometry.attributes.uv.bytes = result.quantized.length * 2;

	}

}
Compressed the given geometry's `uv` attribute.

@param {BufferGeometry} geometry - The geometry whose texture coordinates should be compressed.