DefinitelyTyped/types/node/v0
Jérémie Astori dd0d4ad0c4 Type spawn's args as a ReadonlyArray of string (#25487)
At the moment, this snippet:

```ts
const spawnArgs: ReadonlyArray<string> = ['foo', 'bar'];
spawn('foobar', spawnArgs);
```

fails with:

```
Argument of type 'ReadonlyArray<string>' is not assignable to parameter of type 'string[] | undefined'.
  Type 'ReadonlyArray<string>' is not assignable to type 'string[]'.
```

Looking at https://github.com/nodejs/node/blob/master/lib/child_process.js#L514-L535 and https://github.com/nodejs/node/blob/master/lib/internal/child_process.js#L286, it _looks_ like there is no mutation of the array. I am no expert so I'd be happy to be proven wrong, I just couldn't find sufficient evidence that a `ReadonlyArray` wouldn't be fine.
This is not a breaking change because passing a `string[]` is still valid.
2018-05-03 08:57:27 -07:00
..
index.d.ts
node-tests.ts
tsconfig.json
tslint.json