Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test-d/arguments/env.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ expectType<NodeEnv>('' as NodeJS.ProcessEnv['NODE_ENV']);
expectType<NodeEnv>('' as globalThis.NodeJS.ProcessEnv['NODE_ENV']);

// But Execa's types are not impacted
expectType<string | undefined>('' as Exclude<Options['env'], undefined>['NODE_ENV']);
expectAssignable<Result>(await execa({env: {test: 'example'}})`unicorns`);
expectAssignable<Result>(await execa({env: {test: 'example'} as const})`unicorns`);
expectAssignable<Result>(await execa({env: {test: undefined}})`unicorns`);
expectAssignable<Result>(await execa({env: {test: undefined} as const})`unicorns`);
expectAssignable<Result>(await execa({env: {port: 3000} as const})`unicorns`);
2 changes: 1 addition & 1 deletion types/arguments/options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export type CommonOptions<IsSync extends boolean = boolean> = {

@default [process.env](https://nodejs.org/api/process.html#processenv)
*/
readonly env?: Readonly<Partial<Record<string, string>>>;
readonly env?: Readonly<Partial<Record<string, unknown>>>;

/**
If `true`, the subprocess uses both the `env` option and the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).
Expand Down