Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!isObject(value)) {
next(
new Error(
`projectz: custom package data for package ${name} must be an object`
)
)
return this
}
}
}
// ----------------------------------
// Merging
// Set some basic object defaults
extendr.defaults(this.mergedPackageData, {
badges: {},
readmes: {},
packages: {},
repository: {},
github: {}
// contributors: [],
// sponsors: [],
// maintainers: [],
// authors: []
})
// Ensure badge config
if (!this.mergedPackageData.badges.list)
this.mergedPackageData.badges.list = []
if (!this.mergedPackageData.badges.config)
this.mergedPackageData.badges.config = {}
if (this.prepare) {
this.prepare(...args)
}
// State defaults
extendr.defaults(this.state, {
result: null,
error: null,
status: 'created',
itemsRemaining: [],
itemsExecutingCount: 0,
itemsDoneCount: 0
})
// Configuration defaults
extendr.defaults(this.config, {
// Standard
storeResult: null,
destroyOnceDone: true,
parent: null,
// Unique to TaskGroup
method: null,
abortOnError: true,
destroyDoneItems: true,
nestedTaskConfig: {},
nestedTaskGroupConfig: {},
emitNestedEvents: false,
concurrency: 1,
run: null
})
constructor(...args) {
// Initialise BaseInterface
super()
// State defaults
extendr.defaults(this.state, {
result: null,
error: null,
status: 'created'
})
// Configuration defaults
extendr.defaults(this.config, {
// Standard
storeResult: null,
destroyOnceDone: true,
parent: null,
// Unique to Task
method: null,
errorOnExcessCompletions: true,
ambi: true,
constructor(...args) {
super()
// Prepare (used for class extensions)
if (this.prepare) {
this.prepare(...args)
}
// State defaults
extendr.defaults(this.state, {
result: null,
error: null,
status: 'created',
itemsRemaining: [],
itemsExecutingCount: 0,
itemsDoneCount: 0
})
// Configuration defaults
extendr.defaults(this.config, {
// Standard
storeResult: null,
destroyOnceDone: true,
parent: null,
// Unique to TaskGroup
constructor(...args) {
// Initialise BaseInterface
super()
// State defaults
extendr.defaults(this.state, {
result: null,
error: null,
status: 'created'
})
// Configuration defaults
extendr.defaults(this.config, {
// Standard
storeResult: null,
destroyOnceDone: true,
parent: null,
// Unique to Task
method: null,
errorOnExcessCompletions: true,
ambi: true,
domain: null,
args: null
})
// Apply user configuration
this.setConfig(...args)
}