"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/utils/config/definition.js" between
npm-cli-7.16.0.tar.gz and npm-cli-7.17.0.tar.gz

About: npm is a JavaScript package manager (requires node v6 or higher).

definition.js  (npm-cli-7.16.0):definition.js  (npm-cli-7.17.0)
skipping to change at line 52 skipping to change at line 52
this.key = key this.key = key
// if it's set falsey, don't export it, otherwise we do by default // if it's set falsey, don't export it, otherwise we do by default
this.envExport = true this.envExport = true
Object.assign(this, def) Object.assign(this, def)
this.validate() this.validate()
if (!this.defaultDescription) if (!this.defaultDescription)
this.defaultDescription = describeValue(this.default) this.defaultDescription = describeValue(this.default)
if (!this.typeDescription) if (!this.typeDescription)
this.typeDescription = describeType(this.type) this.typeDescription = describeType(this.type)
// hint is only used for non-boolean values // hint is only used for non-boolean values
if (!this.hint) if (!this.hint) {
this.hint = `<${this.key}>` if (this.type === Number)
this.hint = '<number>'
else
this.hint = `<${this.key}>`
}
if (!this.usage) if (!this.usage)
this.usage = describeUsage(this) this.usage = describeUsage(this)
} }
validate () { validate () {
for (const req of required) { for (const req of required) {
if (!Object.prototype.hasOwnProperty.call(this, req)) if (!Object.prototype.hasOwnProperty.call(this, req))
throw new Error(`config lacks ${req}: ${this.key}`) throw new Error(`config lacks ${req}: ${this.key}`)
} }
if (!this.key) if (!this.key)
 End of changes. 1 change blocks. 
2 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)