@std/collections `zip` with customizable handling of where to truncate (longest vs shortest)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
- #6733 @lionel-rowe による — マージされずにクローズ
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- typescript
調査の方向性
@std/collections の zip エントリーポイントとそのテストを特定し、まず現在の可変長引数シグネチャと既存の挙動を確認してください。オプション形式で undefined によるパディングを伴う最長切り捨てを選択でき、既存の最短切り捨ての挙動を維持したうえで、両方のパスをカバーできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
Sometimes it's useful to zip arrays together without truncating the shorter ones, instead filling with undefined.
Describe the solution you'd like
Allow passing an option such as options.truncate = 'longest' to continue zipping until the longest array ends, filling missing values with undefined.
Describe alternatives you've considered
Not really sure how best to add this to the current function signature, given the variadic ...arrays param.
One possible option would be taking options as an initial parameter, which could be detected at runtime with Array.isArray:
type ZipOptions = {
truncate?: 'shortest' | 'longest';
}
export function zip<T extends unknown[], O extends ZipOptions>(
options: O,
...arrays: { [K in keyof T]: ReadonlyArray<T[K]> }
): {
[K in keyof T]: O extends { truncate: "longest" } ? T[K] | undefined : T[K];
}[];
export function zip<T extends unknown[]>(
...arrays: { [K in keyof T]: ReadonlyArray<T[K]> }
): T[];
export function zip(
...args: unknown[]
): unknown[] {
const [options, arrays] = args.length === 0 || Array.isArray(args[0]) ?
[{}, args as unknown[][]] :
[args[0] as ZipOptions, args.slice(1) as unknown[][]];
Otherwise, it might need to be a separate zipWithOptions function.
- 主要言語
- TypeScript
- スター
- 3.6k
- フォーク
- 713
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
denoland/std のほかの issue
-
`assertEquals` throws on structurally equal `Error` objects due to different stack trace対応中かも @powerman2026 が 1 日前に担当しました。 オープンbug needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
streams: DelimiterStream leaves delimiter bytes in the output when the delimiter spans more than two chunks対応中かも @helmipradita が 15 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
@std/encoding: decodeAscii85 corrupts delimited data ending in "<", decodeVarint32 reads past the end of the buffer対応中かも @helmipradita が 16 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
@std/yaml: stringify() with condenseFlow wraps already quoted keys in a second pair of quotes対応中かも @sebxt が 35 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
@std/ini parse silently drops an entire section when the section name repeats対応中かも @Harsh23Kashyap が 35 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
security: set top-level least-privilege permissions in five workflows対応中かも @JonathanTSilva が今日担当しました。 オープンpriority: p2 size: xs type: security
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
JonathanTSilva/jts-website#150 ·
メンテナーはふだん 1 日以内に返信
-
bug Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
scottbenton/Iron-Link#437 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
speakeasy-api/speakeasy#2159 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vercel-labs/ui#1066 ·
メンテナーはふだん 1 日以内に返信