validate (record, opts) {
    opts || (opts = {})
    const schema = this.getSchema()
    if (!schema) {
      return
    }
    const _opts = utils.pick(opts, ['existingOnly'])
    if (utils.isArray(record)) {
      const errors = record.map((_record) => schema.validate(_record, utils.pick(_opts, ['existingOnly'])))

      return errors.some(Boolean) ? errors : undefined
    }
    return schema.validate(record, _opts)
  }
Validate the given record or records according to this Mapper's
{@link Schema}. If there are no validation errors then the return value
will be `undefined`.

@example
import {Mapper, Schema} from 'js-data'
const PersonSchema = new Schema({
  properties: {
    name: { type: 'string' },
    id: { type: 'string' }
  }
});
const PersonMapper = new Mapper({
  name: 'person',
  schema: PersonSchema
});
let errors = PersonMapper.validate({ name: 'John' });
console.log(errors); // undefined
errors = PersonMapper.validate({ name: 123 });
console.log(errors); // [{ expected: 'one of (string)', actual: 'number', path: 'name' }]

@method Mapper#validate
@param {Object|Object[]} record The record or records to validate.
@param {object} [opts] Configuration options. Passed to
{@link Schema#validate}.
@returns {Object[]} Array of errors or `undefined` if no errors.
@since 3.0.0