Extension of vector-valued functions