mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2025-06-12 07:31:21 +00:00
@ -34,7 +34,7 @@
|
||||
"dependencies": {
|
||||
"@chainsafe/libp2p-noise": "13.0.0",
|
||||
"@chainsafe/libp2p-yamux": "5.0.0",
|
||||
"@fluencelabs/avm": "0.48.0",
|
||||
"@fluencelabs/avm": "0.52.0",
|
||||
"@fluencelabs/interfaces": "workspace:*",
|
||||
"@fluencelabs/marine-worker": "0.3.3",
|
||||
"@libp2p/crypto": "2.0.3",
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -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
|
||||
|
Reference in New Issue
Block a user