grafana / k6-docs

The k6 documentation website.
https://grafana.com/docs/k6/latest/
85 stars 216 forks source link

Browser: Convert all `Array` to `[]` #1593

Open inancgumus opened 4 months ago

inancgumus commented 4 months ago

As discussed here, we want to convert all Array signatures to [] in the k6-browser docs.

It is common to use simple array types in typescript, i.e. Cookie[], for named types:

let a: string[]
let b: boolean[]
let c: SomeInterface[]

The generic version is usually reserved for more complex types, where the brackets might be easy to miss due to the amount of symbols:

let a1: Promise<({ prop: boolean })[]>
// vs.
let a2: Promise<Array<{ prop: boolean }>>

let b1: Promise<(typeof myVal)[]>
// vs.
let b2: Promise<Array<typeof myVal>>

Ups

Downs