code: function validateOptsProperties(opts, validProperties) {
    var validProps = ensureVector(validProperties);
    var allOpts = jd.vector(Object.keys(opts), 'string');
    var invalidOpts = allOpts.s(allOpts.isIn(validProps).not());
    if (invalidOpts.size() > 0) {
      throw new Error('invalid properties found in "opts": ' +
        invalidOpts.strJoin(', '));
    }
  }
docs: Returns undefined or throws an error if invalid