Skip to content

Commit

Permalink
fix(storage-client): remove some extra types
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadhonarvar authored and alimd committed May 19, 2023
1 parent 829cd1d commit 017b8ed
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/storage-client/src/storage-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class AlwatrStorageClient<DocumentType extends AlwatrDocumentObject = Alw
*/
async get<T extends DocumentType = DocumentType>(
documentId: string,
storage: string | undefined = this.config.name,
storage = this.config.name,
): Promise<T | null> {
this._logger.logMethodArgs?.('get', {storage, documentId});
if (storage == null) throw new Error('storage_not_defined');
Expand Down Expand Up @@ -140,7 +140,7 @@ export class AlwatrStorageClient<DocumentType extends AlwatrDocumentObject = Alw
* if (!userExist) console.log('user_not_found');
* ```
*/
async has(documentId: string, storage: string | undefined = this.config.name): Promise<boolean> {
async has(documentId: string, storage = this.config.name): Promise<boolean> {
this._logger.logMethodArgs?.('has', {storage, documentId});
if (storage == null) throw new Error('storage_not_defined');

Expand Down Expand Up @@ -177,7 +177,7 @@ export class AlwatrStorageClient<DocumentType extends AlwatrDocumentObject = Alw
*/
async set<T extends DocumentType = DocumentType>(
documentObject: T,
storage: string | undefined = this.config.name,
storage = this.config.name,
): Promise<T> {
this._logger.logMethodArgs?.('set', {storage, documentId: documentObject.id});
if (storage == null) throw new Error('storage_not_defined');
Expand Down Expand Up @@ -208,7 +208,7 @@ export class AlwatrStorageClient<DocumentType extends AlwatrDocumentObject = Alw
* await userStorage.touch();
* ```
*/
async touch(storage: string | undefined = this.config.name): Promise<void> {
async touch(storage = this.config.name): Promise<void> {
this._logger.logMethodArgs?.('touch', {storage});
if (storage == null) throw new Error('storage_not_defined');

Expand Down Expand Up @@ -284,7 +284,7 @@ export class AlwatrStorageClient<DocumentType extends AlwatrDocumentObject = Alw
*/
async delete(
documentId: string,
storage: string | undefined = this.config.name,
storage = this.config.name,
): Promise<boolean> {
this._logger.logMethodArgs?.('delete', {storage, documentId});
if (storage == null) {
Expand Down Expand Up @@ -318,7 +318,7 @@ export class AlwatrStorageClient<DocumentType extends AlwatrDocumentObject = Alw
* ```
*/
async getStorage<T extends DocumentType = DocumentType>(
name: string | undefined = this.config.name,
name = this.config.name,
): Promise<AlwatrDocumentStorage<T>> {
this._logger.logMethodArgs?.('getStorage', {name});
if (name == null) {
Expand Down Expand Up @@ -358,7 +358,7 @@ export class AlwatrStorageClient<DocumentType extends AlwatrDocumentObject = Alw
* const userIdArray = await userStorage.keys();
* ```
*/
async keys(storage: string | undefined = this.config.name): Promise<Array<string>> {
async keys(storage = this.config.name): Promise<Array<string>> {
this._logger.logMethodArgs?.('keys', {storage});

if (storage == null) {
Expand Down

0 comments on commit 017b8ed

Please sign in to comment.