diff options
Diffstat (limited to 'js/os.ts')
-rw-r--r-- | js/os.ts | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -97,6 +97,17 @@ export function fetchModuleMetaData( }; } +function setEnv(key: string, value: string): void { + const builder = flatbuffers.createBuilder(); + const _key = builder.createString(key); + const _value = builder.createString(value); + msg.SetEnv.startSetEnv(builder); + msg.SetEnv.addKey(builder, _key); + msg.SetEnv.addValue(builder, _value); + const inner = msg.SetEnv.endSetEnv(builder); + sendSync(builder, msg.Any.SetEnv, inner); +} + function createEnv(inner: msg.EnvironRes): { [index: string]: string } { const env: { [index: string]: string } = {}; @@ -113,17 +124,6 @@ function createEnv(inner: msg.EnvironRes): { [index: string]: string } { }); } -function setEnv(key: string, value: string): void { - const builder = flatbuffers.createBuilder(); - const _key = builder.createString(key); - const _value = builder.createString(value); - msg.SetEnv.startSetEnv(builder); - msg.SetEnv.addKey(builder, _key); - msg.SetEnv.addValue(builder, _value); - const inner = msg.SetEnv.endSetEnv(builder); - sendSync(builder, msg.Any.SetEnv, inner); -} - /** Returns a snapshot of the environment variables at invocation. Mutating a * property in the object will set that variable in the environment for * the process. The environment object will only accept `string`s |