chore!: Bump avm (#361)

* Bump avm

* Fix lint
This commit is contained in:
Akim
2023-10-17 23:52:30 +07:00
committed by GitHub
parent 2b7756a717
commit 29ec812fc1
5 changed files with 14 additions and 42 deletions

View File

@ -1,33 +0,0 @@
/**
* Copyright 2023 Fluence Labs Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import process from "process";
import { fetchResource as fetchResourceIsomorphic } from "#fetcher";
const isNode =
// process.release is undefined in browser env
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
typeof process !== "undefined" && process.release?.name === "node";
export async function fetchResource(pkg: string, path: string) {
switch (true) {
case isNode:
return fetchResourceIsomorphic(pkg, path);
default:
return fetchResourceIsomorphic(pkg, path);
}
}

View File

@ -29,10 +29,11 @@ import { BlobWorker, Worker } from "threads/master";
import { ClientPeer, makeClientPeerConfig } from "./clientPeer/ClientPeer.js";
import { callAquaFunction } from "./compilerSupport/callFunction.js";
import { registerService } from "./compilerSupport/registerService.js";
import { fetchResource } from "./fetchers/index.js";
import { MarineBackgroundRunner } from "./marine/worker/index.js";
import { doRegisterNodeUtils } from "./services/NodeUtils.js";
import { fetchResource } from "#fetcher";
const isNode =
// process.release is undefined in browser env
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition