module.exports=normalizevarfixer=require("./fixer")normalize.fixer=fixervarmakeWarning=require("./make_warning")varfieldsToFix=['name','version','description','repository','modules','scripts','files','bin','man','bugs','keywords','readme','homepage','license']varotherThingsToFix=['dependencies','people','typos']varthingsToFix=fieldsToFix.map(function(fieldName){returnucFirst(fieldName)+"Field"})// two ways to do this in CoffeeScript on only one line, sub-70 chars:// thingsToFix = fieldsToFix.map (name) -> ucFirst(name) + "Field"// thingsToFix = (ucFirst(name) + "Field" for name in fieldsToFix)thingsToFix=thingsToFix.concat(otherThingsToFix)functionnormalize(data,warn,strict){if(warn===true)warn=null,strict=trueif(!strict)strict=falseif(!warn||data.private)warn=function(msg){/* noop */}if(data.scripts&&data.scripts.install==="node-gyp rebuild"&&!data.scripts.preinstall){data.gypfile=true}fixer.warn=function(){warn(makeWarning.apply(null,arguments))}thingsToFix.forEach(function(thingName){fixer["fix"+ucFirst(thingName)](data,strict)})data._id=data.name+"@"+data.version}functionucFirst(string){returnstring.charAt(0).toUpperCase()+string.slice(1);}