{"size": 266, "ext": "js", "max_stars_repo_path": "lib/validators/requiredValidator.js", "max_stars_repo_name": "Bencheci/faster-schema", "max_stars_repo_stars_event_min_datetime": "2017-12-07T14:30:44.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-03T02:58:31.000Z", "max_issues_repo_path": "lib/validators/requiredValidator.js", "max_issues_repo_name": "Bencheci/faster-schema", "max_issues_repo_issues_event_min_datetime": "2018-01-09T12:31:42.000Z", "max_issues_repo_issues_event_max_datetime": "2021-11-02T16:57:14.000Z", "max_forks_repo_path": "lib/validators/requiredValidator.js", "max_forks_repo_name": "Bencheci/faster-schema", "max_forks_repo_forks_event_min_datetime": "2019-05-06T12:45:11.000Z", "max_forks_repo_forks_event_max_datetime": "2021-11-02T10:20:22.000Z"}
{"max_stars_count": 16, "max_issues_count": 12, "max_forks_count": 3, "avg_line_length": 29.5555555556, "max_line_length": 72, "alphanum_fraction": 0.6917293233}
import { ErrorTypes } from '../FasterSchema';

export default function requiredValidator({ def, value }) {
  if (def.optional) return;

  // If value is null, no matter what, we add required
  if (value === null || value === undefined) return ErrorTypes.REQUIRED;
}
