Skip to content

Commit b4898ce

Browse files
committed
Updates
1 parent d5a9ac3 commit b4898ce

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

src/plugin.ts

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,11 @@ export class StarbasePluginRegistry {
7878
}): Promise<{ sql: string; params?: unknown[] }> {
7979
let { sql, params } = opts
8080

81-
if (this.plugins?.length) {
82-
await Promise.all(
83-
this.plugins.map(async (plugin: StarbasePlugin) => {
84-
const { sql: _sql, params: _params } =
85-
await plugin.beforeQuery(opts)
86-
sql = _sql
87-
params = _params
88-
})
89-
)
81+
for (const plugin of this.plugins) {
82+
const { sql: _sql, params: _params } =
83+
await plugin.beforeQuery(opts)
84+
sql = _sql
85+
params = _params
9086
}
9187

9288
return {
@@ -104,15 +100,11 @@ export class StarbasePluginRegistry {
104100
}): Promise<any> {
105101
let { result } = opts
106102

107-
if (this.plugins?.length) {
108-
await Promise.all(
109-
this.plugins.map(async (plugin: StarbasePlugin) => {
110-
result = await plugin.afterQuery({
111-
...opts,
112-
result,
113-
})
114-
})
115-
)
103+
for (const plugin of this.plugins) {
104+
result = await plugin.afterQuery({
105+
...opts,
106+
result,
107+
})
116108
}
117109

118110
return result

0 commit comments

Comments
 (0)