Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function packAndCheck(packagerOptions: PackagerOptions, checkOptions: AssertPackOptions) {
const cancellationToken = new CancellationToken()
const packager = new Packager(packagerOptions, cancellationToken)
const publishManager = new PublishManager(packager, {publish: "publish" in checkOptions ? checkOptions.publish : "never"})
const artifacts: Map> = new Map()
packager.artifactCreated(event => {
if (event.file == null) {
return
}
assertThat(event.file).isAbsolute()
addValue(artifacts, event.packager.platform, event)
})
const {outDir, platformToTargets} = await packager.build()
await publishManager.awaitTasks()
if (packagerOptions.platformPackagerFactory != null) {
return {packager, outDir}