Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(cfg) {
super();
this.numBytesWritten = 0;
this.numRetries = 0;
streamEvents.call(this);
cfg = cfg || {};
if (!cfg.bucket || !cfg.file) {
throw new Error('A bucket and file name are required');
}
cfg.authConfig = cfg.authConfig || {};
cfg.authConfig.scopes =
['https://www.googleapis.com/auth/devstorage.full_control'];
this.authClient = cfg.authClient || new google_auth_library_1.GoogleAuth(cfg.authConfig);
this.bucket = cfg.bucket;
this.file = cfg.file;
this.generation = cfg.generation;
this.kmsKeyName = cfg.kmsKeyName;
this.metadata = cfg.metadata || {};
this.offset = cfg.offset;
this.origin = cfg.origin;
this.userProject = cfg.userProject;