function finishedInstall(err) {
  if (err) {
    throw new Error(err)
  }
  const dictionary = {}
  for (const i in list) {
    if (list[i]) {
      const name = list[i]
      const transformer = require('jstransformer-' + name) // eslint-disable-line import/no-dynamic-require
      const formats = transformer.inputFormats || [name]

      for (const n in formats) {
        if (formats[n]) {
          const format = formats[n]
          // Ensure the input format exists in the dictionary.
          if (!dictionary[format]) {
            dictionary[format] = []
          }

          // Add the package to the input format.
          dictionary[format].push('jstransformer-' + name)
        }
      }
    }
  }
  const sorted = sortJson(dictionary)
  fs.writeFileSync('dictionary.json', JSON.stringify(sorted, null, 2))
}
/**
 * Write the dictionary.json based on the installed modules.
 *
 * @param {string} err The error that was reported.
 */
Write the dictionary.json based on the installed modules.
@param {string} err The error that was reported.
Write the dictionary . json based on the installed modules . @param { string } err The error that was reported .
function finishedInstall(err) {
  if (err) {
    throw new Error(err)
  }
  const dictionary = {}
  for (const i in list) {
    if (list[i]) {
      const name = list[i]
      const transformer = require('jstransformer-' + name) 
      const formats = transformer.inputFormats || [name]
      for (const n in formats) {
        if (formats[n]) {
          const format = formats[n]
          if (!dictionary[format]) {
            dictionary[format] = []
          }
          dictionary[format].push('jstransformer-' + name)
        }
      }
    }
  }
  const sorted = sortJson(dictionary)
  fs.writeFileSync('dictionary.json', JSON.stringify(sorted, null, 2))
}
function finishedInstall ( err ) { if ( err ) { throw new Error ( err ) } const dictionary = { } for ( const i in list ) { if ( list [ i ] ) { const name = list [ i ] const transformer = require ( 'jstransformer-' + name ) const formats = transformer . inputFormats || [ name ] for ( const n in formats ) { if ( formats [ n ] ) { const format = formats [ n ] if ( ! dictionary [ format ] ) { dictionary [ format ] = [ ] } dictionary [ format ] . push ( 'jstransformer-' + name ) } } } } const sorted = sortJson ( dictionary ) fs . writeFileSync ( 'dictionary.json' , JSON . stringify ( sorted , null , 2 ) ) }
Write the dictionary.json based on the installed modules.
Write the dictionary . json based on the installed modules .
// eslint-disable-line import/no-dynamic-require // Ensure the input format exists in the dictionary. // Add the package to the input format.