code: function validateVectorIsDtype(vector, dtype) {
    if (vector.dtype !== dtype) {
      throw new Error('expected vector dtype to be "' + dtype + '" but got "' +
        vector.dtype + '"');
    }
  }
docs: Returns undefined or throws an error if invalid