src/utils.js
/**
 * Validates draft version.
 *
 * @param  {string} draft - Output JSON Schema draft version.
 * throws {Error} If specified draft is not supported.
 */
Validates draft version.
@param  {string} draft - Output JSON Schema draft version.
throws {Error} If specified draft is not supported.
Validates draft version . @param { string } draft - Output JSON Schema draft version . throws { Error } If specified draft is not supported .
function validateDraft (draft) {
  const supportedDrafts = ['04', '06', '07']
  if (supportedDrafts.indexOf(draft) < 0) {
    throw new Error(
      `Unsupported draft version. Supported versions are: ${supportedDrafts}`)
  }
}
function validateDraft ( draft ) { const supportedDrafts = [ '04' , '06' , '07' ] if ( supportedDrafts . indexOf ( draft ) < 0 ) { throw new Error ( ` ${ supportedDrafts } ` ) } }
Validates draft version.
Validates draft version .