Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const runBasicCases: RunBasicCases = (t, ev = createEvaluator().evaluate) => cases =>
pSeries(cases.map(([input, expected]) => async () =>
t.deepEqual(await ev(input), expected, input)
)).then(() => {}) // eslint-disable-line promise/prefer-await-to-then
} else {
const providerNames = tabsProvider.getProviderNames();
await dialog.showOpenFileErrorDialog(getOpenFileErrorDialog({
name,
providerNames
}));
}
}
}
return tab;
};
});
const openResults = await pSeries(openTasks);
// filter out empty elements
const openedTabs = openResults.filter(openedTab => openedTab);
return openedTabs.slice().reverse();
}
// skip below because of flow issue with async/await
// todo: remove `FlowFixMe` when [this](https://github.com/facebook/flow/issues/5294) issue is fixed
// $FlowFixMe
} = await this.client.execute(existingObjectsRequest)
const requestsList = batches.map(
(newObjects: Array): Array =>
this._createOrUpdateObjects(existingObjects, newObjects)
)
const functionsList = requestsList.map(
(requests: Array): Function =>
this._createPromiseReturningFunction(requests)
)
return pSeries(functionsList).then((): Promise => Promise.resolve())
}
test('Sizes of popular UI Frameworks', async t => {
const promises = UIPackages.map(pack => async () => {
const res = await fetch(`${process.env.SERVER_ENDPOINT}/size?p=${encodeURIComponent(pack.name)}`)
const json = await res.json()
console.log(json, pack)
t.truthy(isDeltaOk(json.size, pack.size), `Size delta too large, ${json.size - pack.size}`)
})
await pSeries(promises)
.catch(r => console.log(r))
})
const writeInputsArray = async (inputsArr: InteractiveInput[]) => {
const writeInputsP = inputsArr.map(wrapInputWriting);
return pSeries(writeInputsP);
};
const writeInputsArray = async (inputsArr: InteractiveInput[]) => {
const writeInputsP = inputsArr.map(wrapInputWriting);
return pSeries(writeInputsP);
};
saveAllTabs = () => {
const {
tabs
} = this.state;
const saveTasks = tabs
.filter((tab) => {
return this.isDirty(tab) || this.isUnsaved(tab);
}).map((tab) => {
return () => this.saveTab(tab);
});
return pSeries(saveTasks);
}