Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
pz.on('data', function (data) {
Object.keys(data).forEach(function (k) {
if (data[k] !== undefined && data[k] !== null) pkg[k] = data[k]
})
// only do a few of these.
// no need for mans or contributors if they're in the files
var es = readJson.extraSet
readJson.extraSet = es.filter(function (fn) {
return fn.name !== 'authors' && fn.name !== 'mans'
})
readJson.extras(packageFile, pkg, function (er, pkg) {
readJson.extraSet = es
if (er) return cb(er, pkg)
pkg = unParsePeople(pkg)
// no need for the readme now.
delete pkg.readme
delete pkg.readmeFilename
// really don't want to have this lying around in the file
delete pkg._id
// ditto
delete pkg.gitHead
readJson(packageFile, function (er, d) {
readJson.extraSet = es
if (er) pkg = {}
else pkg = d
ctx.filename = packageFile
ctx.dirname = path.dirname(packageFile)
ctx.basename = path.basename(ctx.dirname)
if (!pkg.version || !semver.valid(pkg.version))
delete pkg.version
ctx.package = pkg
ctx.config = config || {}
// make sure that the input is valid.
// if not, use the default
var pz = new PZ(input, ctx)
readJson(packageFile, function (er, d) {
readJson.extraSet = es
if (er) pkg = {}
else pkg = d
ctx.filename = packageFile
ctx.dirname = path.dirname(packageFile)
ctx.basename = path.basename(ctx.dirname)
if (!pkg.version || !semver.valid(pkg.version))
delete pkg.version
ctx.package = pkg
ctx.config = config || {}
// make sure that the input is valid.
// if not, use the default
var pz = new PZ(input, ctx)
pz.on('data', function (data) {
Object.keys(data).forEach(function (k) {
if (data[k] !== undefined && data[k] !== null) pkg[k] = data[k]
})
// only do a few of these.
// no need for mans or contributors if they're in the files
var es = readJson.extraSet
readJson.extraSet = es.filter(function (fn) {
return fn.name !== 'authors' && fn.name !== 'mans'
})
readJson.extras(packageFile, pkg, function (er, pkg) {
readJson.extraSet = es
if (er) return cb(er, pkg)
pkg = unParsePeople(pkg)
// no need for the readme now.
delete pkg.readme
delete pkg.readmeFilename
// really don't want to have this lying around in the file
delete pkg._id
// ditto
delete pkg.gitHead
pz.on('data', function (data) {
Object.keys(data).forEach(function (k) {
if (data[k] !== undefined && data[k] !== null) pkg[k] = data[k]
})
// only do a few of these.
// no need for mans or contributors if they're in the files
var es = readJson.extraSet
readJson.extraSet = es.filter(function (fn) {
return fn.name !== 'authors' && fn.name !== 'mans'
})
readJson.extras(packageFile, pkg, function (er, pkg) {
readJson.extraSet = es
if (er) return cb(er, pkg)
pkg = unParsePeople(pkg)
// no need for the readme now.
delete pkg.readme
delete pkg.readmeFilename
// really don't want to have this lying around in the file
delete pkg._id
// ditto
delete pkg.gitHead
get: function (k) {
return data[k]
},
toJSON: function () {
return data
}
}
}
var packageFile = path.resolve(dir, 'package.json')
input = path.resolve(input)
var pkg
var ctx = { yes: yes(config) }
var es = readJson.extraSet
readJson.extraSet = es.filter(function (fn) {
return fn.name !== 'authors' && fn.name !== 'mans'
})
readJson(packageFile, function (er, d) {
readJson.extraSet = es
if (er) pkg = {}
else pkg = d
ctx.filename = packageFile
ctx.dirname = path.dirname(packageFile)
ctx.basename = path.basename(ctx.dirname)
if (!pkg.version || !semver.valid(pkg.version))
delete pkg.version
ctx.package = pkg
ctx.config = config || {}
config = {
get: function (k) {
return data[k]
},
toJSON: function () {
return data
}
}
}
var packageFile = path.resolve(dir, 'package.json')
input = path.resolve(input)
var pkg
var ctx = { yes: yes(config) }
var es = readJson.extraSet
readJson.extraSet = es.filter(function (fn) {
return fn.name !== 'authors' && fn.name !== 'mans'
})
readJson(packageFile, function (er, d) {
readJson.extraSet = es
if (er) pkg = {}
else pkg = d
ctx.filename = packageFile
ctx.dirname = path.dirname(packageFile)
ctx.basename = path.basename(ctx.dirname)
if (!pkg.version || !semver.valid(pkg.version))
delete pkg.version
ctx.package = pkg
config = {
get: function (k) {
return data[k]
},
toJSON: function () {
return data
}
}
}
var packageFile = path.resolve(dir, 'package.json')
input = path.resolve(input)
var pkg
var ctx = { yes: yes(config) }
var es = readJson.extraSet
readJson.extraSet = es.filter(function (fn) {
return fn.name !== 'authors' && fn.name !== 'mans'
})
readJson(packageFile, function (er, d) {
readJson.extraSet = es
if (er) pkg = {}
else pkg = d
ctx.filename = packageFile
ctx.dirname = path.dirname(packageFile)
ctx.basename = path.basename(ctx.dirname)
if (!pkg.version || !semver.valid(pkg.version))
delete pkg.version
ctx.package = pkg