@form8ion/core
Advanced tools
Comparing version 1.2.3-alpha.1 to 1.3.0-alpha.1
@@ -43,15 +43,27 @@ 'use strict'; | ||
function unlicensedConfirmationShouldBePresented(answers) { | ||
return 'Private' === answers[questionNames.VISIBILITY]; | ||
function unlicensedConfirmationShouldBePresented(decisions) { | ||
return answers => { | ||
const values = {...decisions, ...answers}; | ||
return 'Private' === values[questionNames.VISIBILITY]; | ||
}; | ||
} | ||
function licenseChoicesShouldBePresented(answers) { | ||
return 'Public' === answers[questionNames.VISIBILITY] || !answers[questionNames.UNLICENSED]; | ||
function licenseChoicesShouldBePresented(decisions) { | ||
return answers => { | ||
const values = {...decisions, ...answers}; | ||
return 'Public' === values[questionNames.VISIBILITY] || !values[questionNames.UNLICENSED]; | ||
}; | ||
} | ||
function copyrightInformationShouldBeRequested(answers) { | ||
return !!answers[questionNames.LICENSE]; | ||
function copyrightInformationShouldBeRequested(decisions) { | ||
return answers => { | ||
const values = {...decisions, ...answers}; | ||
return !!values[questionNames.LICENSE]; | ||
}; | ||
} | ||
function includeLicenseQuestions(copyrightHolder) { | ||
function includeLicenseQuestions(decisions, copyrightHolder) { | ||
return [ | ||
@@ -62,3 +74,3 @@ { | ||
type: 'confirm', | ||
when: unlicensedConfirmationShouldBePresented, | ||
when: unlicensedConfirmationShouldBePresented(decisions), | ||
default: true | ||
@@ -70,3 +82,3 @@ }, | ||
type: 'list', | ||
when: licenseChoicesShouldBePresented, | ||
when: licenseChoicesShouldBePresented(decisions), | ||
choices: Array.from(spdxLicenseList__default['default']), | ||
@@ -105,3 +117,3 @@ default: 'MIT' | ||
}, | ||
...includeLicenseQuestions(copyrightHolder) | ||
...includeLicenseQuestions(decisions, copyrightHolder) | ||
]; | ||
@@ -108,0 +120,0 @@ } |
@@ -35,15 +35,27 @@ import { promises } from 'fs'; | ||
function unlicensedConfirmationShouldBePresented(answers) { | ||
return 'Private' === answers[questionNames.VISIBILITY]; | ||
function unlicensedConfirmationShouldBePresented(decisions) { | ||
return answers => { | ||
const values = {...decisions, ...answers}; | ||
return 'Private' === values[questionNames.VISIBILITY]; | ||
}; | ||
} | ||
function licenseChoicesShouldBePresented(answers) { | ||
return 'Public' === answers[questionNames.VISIBILITY] || !answers[questionNames.UNLICENSED]; | ||
function licenseChoicesShouldBePresented(decisions) { | ||
return answers => { | ||
const values = {...decisions, ...answers}; | ||
return 'Public' === values[questionNames.VISIBILITY] || !values[questionNames.UNLICENSED]; | ||
}; | ||
} | ||
function copyrightInformationShouldBeRequested(answers) { | ||
return !!answers[questionNames.LICENSE]; | ||
function copyrightInformationShouldBeRequested(decisions) { | ||
return answers => { | ||
const values = {...decisions, ...answers}; | ||
return !!values[questionNames.LICENSE]; | ||
}; | ||
} | ||
function includeLicenseQuestions(copyrightHolder) { | ||
function includeLicenseQuestions(decisions, copyrightHolder) { | ||
return [ | ||
@@ -54,3 +66,3 @@ { | ||
type: 'confirm', | ||
when: unlicensedConfirmationShouldBePresented, | ||
when: unlicensedConfirmationShouldBePresented(decisions), | ||
default: true | ||
@@ -62,3 +74,3 @@ }, | ||
type: 'list', | ||
when: licenseChoicesShouldBePresented, | ||
when: licenseChoicesShouldBePresented(decisions), | ||
choices: Array.from(spdxLicenseList), | ||
@@ -97,3 +109,3 @@ default: 'MIT' | ||
}, | ||
...includeLicenseQuestions(copyrightHolder) | ||
...includeLicenseQuestions(decisions, copyrightHolder) | ||
]; | ||
@@ -100,0 +112,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "1.2.3-alpha.1", | ||
"version": "1.3.0-alpha.1", | ||
"files": [ | ||
@@ -65,3 +65,3 @@ "example.js", | ||
"lockfile-lint": "4.3.7", | ||
"mocha": "8.2.0", | ||
"mocha": "8.2.1", | ||
"mock-fs": "4.13.0", | ||
@@ -68,0 +68,0 @@ "npm-run-all": "4.1.5", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28876
202