onnxruntime/js/web/lib/onnxjs
Yulong Wang b8917ad84f
[js/web] fix nodejs detection (#16400)
### Description
We used to use `typeof fetch === 'undefined'` as condition to detect the
environment is Node.js or not. Before Node.js v18, this works. However,
in Node.js v18, it introduced `fetch` function, so this check does not
work any more.

This PR changes the condition to check whether `process`,
`process.versions` and `process.versions.node` exists.

Checking whether `process` exists is not enough. This is because in some
configuration, webpack may polyfill nodejs's process.
2023-06-20 00:20:58 -07:00
..
backends [js/web] WebGPU backend via JSEP (#14579) 2023-04-24 15:21:18 -07:00
ort-schema Introduce float 8 types (#14731) 2023-05-30 13:25:58 -07:00
attribute-with-cache-key.ts
attribute.ts [js] upgrade async@3.2.3 /js/ (#11421) 2022-05-03 23:41:36 -07:00
backend.ts [js/web] WebGPU backend via JSEP (#14579) 2023-04-24 15:21:18 -07:00
execution-plan.ts
graph.ts ORT_Web - JS graph parsing update (#15185) 2023-03-31 09:26:55 -07:00
instrument.ts [js] upgrade dependencies and enable strict mode (#14930) 2023-03-22 15:05:04 -07:00
model.ts [js] upgrade async@3.2.3 /js/ (#11421) 2022-05-03 23:41:36 -07:00
operators.ts
opset.ts [js/web] WebGPU backend via JSEP (#14579) 2023-04-24 15:21:18 -07:00
session-handler.ts [js] upgrade async@3.2.3 /js/ (#11421) 2022-05-03 23:41:36 -07:00
session.ts [js/web] fix nodejs detection (#16400) 2023-06-20 00:20:58 -07:00
tensor.ts [js] upgrade async@3.2.3 /js/ (#11421) 2022-05-03 23:41:36 -07:00
util.ts replace 'master' branch ref to 'main' for onnx repo (#12678) 2022-08-30 13:41:42 -07:00