utils/moduleVisitor.js
function makeOptionsSchema(additionalProperties) {
  const base =  {
    'type': 'object',
    'properties': {
      'commonjs': { 'type': 'boolean' },
      'amd': { 'type': 'boolean' },
      'esmodule': { 'type': 'boolean' },
      'ignore': {
        'type': 'array',
        'minItems': 1,
        'items': { 'type': 'string' },
        'uniqueItems': true,
      },
    },
    'additionalProperties': false,
  }

  if (additionalProperties){
    for (let key in additionalProperties) {
      base.properties[key] = additionalProperties[key]
    }
  }

  return base
}
function makeOptionsSchema(additionalProperties) {
  const base =  {
    'type': 'object',
    'properties': {
      'commonjs': { 'type': 'boolean' },
      'amd': { 'type': 'boolean' },
      'esmodule': { 'type': 'boolean' },
      'ignore': {
        'type': 'array',
        'minItems': 1,
        'items': { 'type': 'string' },
        'uniqueItems': true,
      },
    },
    'additionalProperties': false,
  }

  if (additionalProperties){
    for (let key in additionalProperties) {
      base.properties[key] = additionalProperties[key]
    }
  }

  return base
}
function makeOptionsSchema ( additionalProperties ) { const base = { 'type' : 'object' , 'properties' : { 'commonjs' : { 'type' : 'boolean' } , 'amd' : { 'type' : 'boolean' } , 'esmodule' : { 'type' : 'boolean' } , 'ignore' : { 'type' : 'array' , 'minItems' : 1 , 'items' : { 'type' : 'string' } , 'uniqueItems' : true , } , } , 'additionalProperties' : false , } if ( additionalProperties ) { for ( let key in additionalProperties ) { base . properties [ key ] = additionalProperties [ key ] } } return base }
make an options schema for the module visitor, optionally
adding extra fields.
make an options schema for the module visitor optionally adding extra fields .