tweedegolf / storage-abstraction

Provides an abstraction layer for interacting with a storage; the storage can be local or in the cloud.
MIT License
110 stars 18 forks source link

Slug is not set to adapter #11

Closed eduardhasanaj closed 1 year ago

eduardhasanaj commented 3 years ago

I am using this package and I have observed that slug is not set to adapter according to the value specified in config object. Instead I set it manually after the storage is created. This happens in GoogleCloudStorageAdapter.

let storage = new Storage(options);
storage.adapter.slug = false;
await storage.init();
abudaan commented 1 year ago

When I try to create a bucket with a space, like for instance "the buck", GCS complains that the bucketname is invalid.

Error: Invalid bucket name: 'the buck'
abudaan commented 1 year ago

In version 1.4.5 the key slug has been removed from the config object: the responsibility for providing a valid bucket name has therefor shifted onto the programmer. I think this a more flexible approach.