mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
526993965a
- Part of the effort to split Ghost down into smaller, decoupled pieces - Moved out our internal validator tooling to a separate library - Replaced all usage of our own tooling and validatorjs directly with @tryghost/validator - Removed the validatorjs dependency and removed the renovate pin - This gives us a consistant, smaller, clearer public API for validations - It will eventually be used on Ghost Admin too - This way we can start getting up to date with validator whilst not increasing build size
19 lines
481 B
JavaScript
19 lines
481 B
JavaScript
const _ = require('lodash');
|
|
const validator = require('@tryghost/validator');
|
|
const BaseMapGenerator = require('./base-generator');
|
|
|
|
class UserMapGenerator extends BaseMapGenerator {
|
|
constructor(opts) {
|
|
super();
|
|
|
|
this.name = 'authors';
|
|
_.extend(this, opts);
|
|
}
|
|
|
|
validateImageUrl(imageUrl) {
|
|
return imageUrl && validator.isURL(imageUrl, {protocols: ['http', 'https'], require_protocol: true});
|
|
}
|
|
}
|
|
|
|
module.exports = UserMapGenerator;
|