@std/collections `zip` with customizable handling of where to truncate (longest vs shortest)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
- #6733 de @lionel-rowe — cerrado sin fusionar
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- typescript
- Área
- developer-experience
Línea de trabajo
Localiza el punto de entrada zip de @std/collections y sus pruebas; lee primero la firma variádica actual y el comportamiento existente. Se considera terminado cuando una forma con opciones puede seleccionar el truncamiento más largo con relleno de undefined, conservando el comportamiento existente de truncamiento más corto, con cobertura para ambas rutas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.6k
- Forks
- 713
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de denoland/std
-
`assertEquals` throws on structurally equal `Error` objects due to different stack tracePosiblemente ocupada @powerman2026 la tomó hace 1 día. Abiertobug needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
streams: DelimiterStream leaves delimiter bytes in the output when the delimiter spans more than two chunksPosiblemente ocupada @helmipradita la tomó hace 15 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
@std/encoding: decodeAscii85 corrupts delimited data ending in "<", decodeVarint32 reads past the end of the bufferPosiblemente ocupada @helmipradita la tomó hace 16 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
@std/yaml: stringify() with condenseFlow wraps already quoted keys in a second pair of quotesPosiblemente ocupada @sebxt la tomó hace 35 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
@std/ini parse silently drops an entire section when the section name repeatsPosiblemente ocupada @Harsh23Kashyap la tomó hace 35 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
Todos los issues de denoland/std
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
security: set top-level least-privilege permissions in five workflowsPosiblemente ocupada @JonathanTSilva la tomó hoy. Abiertopriority: p2 size: xs type: security
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
JonathanTSilva/jts-website#150 ·
Los mantenedores suelen responder en 1 día
-
[BUG] SETUP.md is out of dateAbiertobug Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
scottbenton/Iron-Link#437 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
speakeasy-api/speakeasy#2159 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
vercel-labs/ui#1066 ·
Los mantenedores suelen responder en 1 día