mirror of
https://github.com/denoland/deno.git
synced 2024-12-01 16:51:13 -05:00
fix: set env,key for string and value for string (#1567)
This commit is contained in:
parent
41cf82870b
commit
2547f0296f
1 changed files with 3 additions and 3 deletions
6
js/os.ts
6
js/os.ts
|
@ -95,8 +95,8 @@ function createEnv(inner: msg.EnvironRes): { [index: string]: string } {
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Proxy(env, {
|
return new Proxy(env, {
|
||||||
set(obj, prop: string, value: string | number) {
|
set(obj, prop: string, value: string) {
|
||||||
setEnv(prop, value.toString());
|
setEnv(prop, value);
|
||||||
return Reflect.set(obj, prop, value);
|
return Reflect.set(obj, prop, value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -115,7 +115,7 @@ function setEnv(key: string, value: string): void {
|
||||||
|
|
||||||
/** Returns a snapshot of the environment variables at invocation. Mutating a
|
/** Returns a snapshot of the environment variables at invocation. Mutating a
|
||||||
* property in the object will set that variable in the environment for
|
* property in the object will set that variable in the environment for
|
||||||
* the process. The environment object will only accept `string`s or `number`s
|
* the process. The environment object will only accept `string`s
|
||||||
* as values.
|
* as values.
|
||||||
*
|
*
|
||||||
* import { env } from "deno";
|
* import { env } from "deno";
|
||||||
|
|
Loading…
Reference in a new issue