Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import * as fs from 'fs';
import * as CircuitBreaker from 'opossum';
import { promisify } from 'util';
let breaker: CircuitBreaker;
const callbackNoArgs = async () => console.log('foo');
CircuitBreaker.isOurError(new Error()); // $ExpectType boolean
breaker = new CircuitBreaker(async () => true, {
timeout: 1000,
maxFailures: 50,
resetTimeout: 10,
rollingCountTimeout: 500,
rollingCountBuckets: 20,
name: 'test',
group: 'group',
rollingPercentilesEnabled: true,
capacity: 1,
errorThresholdPercentage: 1,
enabled: true,
allowWarmUp: true,
volumeThreshold: 1,
cache: true,