Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const blobManipulate = (anyInSystem: AlloyComponent, blob: Blob, filter: (ir: ImageResult) => ImageResult | PromiseLike, action: (blob: Blob) => string, swap: () => void): Promise> => {
block(anyInSystem);
return ResultConversions.blobToImageResult(blob).
then(filter).
then(imageResultToBlob).
then(action).
then((url) => {
return updateSrc(anyInSystem, url).then((oImg) => {
updateButtonUndoStates(anyInSystem);
swap();
unblock(anyInSystem);
return oImg;
});
}).catch((err) => {
// tslint:disable-next-line:no-console
console.log(err); // TODO: Notify the user?
unblock(anyInSystem);
return err;
});