CacheControl / CacheControl/json-rules-engine
Type of `Engine.on()` is wrong
- 主要言語
- JavaScript
- スター
- 3.1k
- フォーク
- 507
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
If you register an event handler on a specific event (i.e. `Engine.on("my-event", ...)`), the first argument of the method will be the `params` of the `Event` definition (type: `Record`), not the `Event` object itself.
I'm not sure if this only the case for specific events or more generally the `EventHandler`:
https://github.com/CacheControl/json-rules-engine/blob/90272d61ed7bea8b7d4000305511e932490d2e2e/types/index.d.ts#L106-L110
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
Start at types/index.d.ts around lines 106-110, linked from the issue, and compare the declared EventHandler type with the behavior of Engine.on("my-event", ...). Confirm what the callback receives for a specific event, then update the declaration so its first argument reflects the Event definition's params; add or adjust a type check if the repository provides one.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- developer-experience
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100