@flatfile/safe-api
Version:
Flatfile Safe API client with streaming capabilities
50 lines (49 loc) • 1.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.config = exports.InternalConfig = void 0;
/**
* @internal
*/
class InternalConfig {
constructor() {
this._debug = false;
this._retryConfig = {
retry: true,
maxAttempts: 5,
timeoutDelay: 500
};
}
static getInstance() {
if (!InternalConfig.instance) {
InternalConfig.instance = new InternalConfig();
}
return InternalConfig.instance;
}
/**
* @internal
*/
mergeRetryConfig(callOptions) {
return {
...this._retryConfig,
...(callOptions || {})
};
}
get debug() {
return this._debug;
}
set debug(value) {
this._debug = value;
}
get retryConfig() {
return this._retryConfig;
}
set retryConfig(value) {
this._retryConfig = {
...this._retryConfig,
...value
};
}
}
exports.InternalConfig = InternalConfig;
// Create and export the singleton instance
exports.config = InternalConfig.getInstance();