File tree Expand file tree Collapse file tree 5 files changed +27
-4
lines changed Expand file tree Collapse file tree 5 files changed +27
-4
lines changed Original file line number Diff line number Diff line change
1
+ <a name =" 4.0.0 " ></a >
2
+ # [ 4.0.0] ( https://github.com/ipfs/js-ipfs-utils/compare/v3.0.0...v4.0.0 ) (2020-10-10)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * use native fetch if available ([ #62 ] ( https://github.com/ipfs/js-ipfs-utils/issues/62 ) ) ([ 9b0ff2f] ( https://github.com/ipfs/js-ipfs-utils/commit/9b0ff2f ) )
8
+
9
+
10
+
1
11
<a name =" 3.0.0 " ></a >
2
12
# [ 3.0.0] ( https://github.com/ipfs/js-ipfs-utils/compare/v2.4.0...v3.0.0 ) (2020-08-18)
3
13
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " ipfs-utils" ,
3
- "version" : " 3 .0.0" ,
3
+ "version" : " 4 .0.0" ,
4
4
"description" : " Package to aggregate shared logic and dependencies for the IPFS ecosystem" ,
5
5
"main" : " src/index.js" ,
6
6
"author" : " Hugo Dias <hugomrdias@gmail.com>" ,
17
17
"./src/text-decoder.js" : " ./src/text-decoder.browser.js" ,
18
18
"./src/temp-dir.js" : " ./src/temp-dir.browser.js" ,
19
19
"./src/path-join.js" : " ./src/path-join.browser.js" ,
20
- "./test/files/glob-source.spec.js" : false
20
+ "./test/files/glob-source.spec.js" : false ,
21
+ "@achingbrain/electron-fetch" : false
21
22
},
22
23
"repository" : " github:ipfs/js-ipfs-utils" ,
23
24
"scripts" : {
37
38
"abort-controller" : " ^3.0.0" ,
38
39
"any-signal" : " ^2.1.0" ,
39
40
"buffer" : " ^5.6.0" ,
41
+ "@achingbrain/electron-fetch" : " ^1.7.2" ,
40
42
"err-code" : " ^2.0.0" ,
41
43
"fs-extra" : " ^9.0.1" ,
42
44
"is-electron" : " ^2.2.0" ,
46
48
"nanoid" : " ^3.1.3" ,
47
49
"native-abort-controller" : " 0.0.3" ,
48
50
"native-fetch" : " ^2.0.0" ,
51
+ "node-fetch" : " ^2.6.0" ,
49
52
"stream-to-it" : " ^0.2.0" ,
50
53
"it-to-stream" : " ^0.1.2"
51
54
},
Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
3
+ const { isElectronMain } = require ( './env' )
4
+
5
+ if ( isElectronMain ) {
6
+ module . exports = require ( '@achingbrain/electron-fetch' )
7
+ } else {
8
+ // use window.fetch if it is available, fall back to node-fetch if not
9
+ module . exports = require ( 'native-fetch' )
10
+ }
Original file line number Diff line number Diff line change 2
2
/* eslint-env browser */
3
3
4
4
const { TimeoutError, AbortError } = require ( './error' )
5
- const fetch = require ( 'native- fetch' )
5
+ const fetch = require ( '../ fetch' )
6
6
const { Request, Response, Headers } = fetch
7
7
8
8
/**
Original file line number Diff line number Diff line change 3
3
4
4
/** @type {import('node-fetch') & typeof fetch } */
5
5
// @ts -ignore
6
- const nodeFetch = require ( 'native- fetch' )
6
+ const nodeFetch = require ( '../ fetch' )
7
7
const toStream = require ( 'it-to-stream' )
8
8
const { Buffer } = require ( 'buffer' )
9
9
const { Request, Response, Headers } = nodeFetch
You can’t perform that action at this time.
0 commit comments