Skip to content

Commit

Permalink
fix(Array): Fix array not properly async
Browse files Browse the repository at this point in the history
  • Loading branch information
Belphemur committed Aug 1, 2022
1 parent 2b7d573 commit 26355b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/JsonDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ export class JsonDB {
return (await this.getArrayData(dataPath)).indexOf(searchValue)
}

private getArrayData(dataPath: string) : Promise<any>{
const result = this.getData(dataPath)
private async getArrayData(dataPath: string): Promise<any> {
const result = await this.getData(dataPath)
if (!Array.isArray(result)) {
throw new DataError(`DataPath: ${dataPath} is not an array.`, 11)
}
Expand Down

0 comments on commit 26355b0

Please sign in to comment.