Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
let source
let gherkinDocument
const pickles = []
const envelopes = []
const messageStream = Gherkin.fromSources(sources)
messageStream.on('data', envelope => {
envelopes.push(envelope)
if (envelope.source) {
source = envelope.source
}
if (envelope.gherkinDocument) {
gherkinDocument = envelope.gherkinDocument
}
if (envelope.pickle) {
pickles.push(envelope.pickle)
envelopes.push(
messages.Envelope.fromObject({
pickleAccepted: { pickleId: envelope.pickle.id },
})
)
}