a-synchronous / a-synchronous/rubico

`get` to stop supporting array paths

未關閉
#272 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
breaking enhancement
主要語言
JavaScript
星號
283
分支
17
PR 合併指標
30 天內沒有已合併 PR

描述

Currently `get` is able to support array paths to access properties on an object

```
get({ a: { b: { c: 1 } } }, ['a', 'b', 'c']) // 1
```

However this blocks the eager API when trying to access indexed values on an array. It returns a function instead for the lazy API.

```
get([1, 2, 3], 0) // [Function: arg0Resolver]
```

We should amend the API to stop supporting array paths so we can eagerly access arrays.

貢獻指南

開啟貢獻指南

研究方向

查看程式碼庫中 `get` 函式的實作,可能位於 `get.js` 或 `index.js` 之類的檔案中。了解目前如何處理陣列路徑,以及 eager API 與 lazy API 如何運作。此變更涉及修改函式,使其不再接受陣列路徑,讓使用者可以直接存取陣列索引。執行現有的 `get` 測試來測試此變更,並確保陣列索引存取會傳回值(例如,`get([1,2,3], 0)` 傳回 `1`)。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript
領域
backend-api-design
Issue 類型
重構
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
描述清楚
新手友好度
50/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。