summaryrefslogtreecommitdiff
path: root/js/os.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/os.ts')
-rw-r--r--js/os.ts22
1 files changed, 11 insertions, 11 deletions
diff --git a/js/os.ts b/js/os.ts
index 03bb7bb42..f95114f04 100644
--- a/js/os.ts
+++ b/js/os.ts
@@ -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