Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

chore: update uint8arrays in every package #3774

Merged
merged 12 commits into from
Aug 25, 2021
4 changes: 2 additions & 2 deletions packages/interface-ipfs-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"it-pushable": "^1.4.2",
"it-tar": "^4.0.0",
"it-to-buffer": "^2.0.0",
"libp2p-crypto": "^0.19.6",
"libp2p-crypto": "^0.19.7",
"libp2p-websockets": "^0.16.1",
"multiaddr": "^10.0.0",
"multiformats": "^9.4.1",
Expand All @@ -78,7 +78,7 @@
"peer-id": "^0.15.1",
"readable-stream": "^3.4.0",
"sinon": "^11.1.1",
"uint8arrays": "^2.1.6"
"uint8arrays": "^3.0.0"
},
"contributors": [
"Alan Shaw <alan.shaw@protocol.ai>",
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/add-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const { supportsFileReader } = require('ipfs-utils/src/supports')
const globSource = require('ipfs-utils/src/files/glob-source')
const { isNode } = require('ipfs-utils/src/env')
const { getDescribe, getIt, expect } = require('./utils/mocha')
const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const bufferStream = require('it-buffer-stream')
const raw = require('multiformats/codecs/raw')
const dagPb = require('@ipld/dag-pb')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { isNode } = require('ipfs-utils/src/env')
const { getDescribe, getIt, expect } = require('./utils/mocha')
const echoUrl = (/** @type {string} */ text) => `${process.env.ECHO_SERVER}/download?data=${encodeURIComponent(text)}`
const redirectUrl = (/** @type {string} */ url) => `${process.env.ECHO_SERVER}/redirect?to=${encodeURI(url)}`
const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const last = require('it-last')
const raw = require('multiformats/codecs/raw')
const dagPb = require('@ipld/dag-pb')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/bitswap/transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { isWebWorker } = require('ipfs-utils/src/env')
const { randomBytes } = require('iso-random-stream')
const concat = require('it-concat')
const { nanoid } = require('nanoid')
const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const pmap = require('p-map')
const getIpfsOptions = require('../utils/ipfs-options-websockets-filter-all')

Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/block/get.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { identity } = require('multiformats/hashes/identity')
const { CID } = require('multiformats/cid')
const { getDescribe, getIt, expect } = require('../utils/mocha')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/block/put.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { base58btc } = require('multiformats/bases/base58')
const { CID } = require('multiformats/cid')
const { getDescribe, getIt, expect } = require('../utils/mocha')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/block/rm.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const { nanoid } = require('nanoid')
const all = require('it-all')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/block/stat.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { CID } = require('multiformats/cid')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const testTimeout = require('../utils/test-timeout')
Expand Down
6 changes: 3 additions & 3 deletions packages/interface-ipfs-core/src/cat.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const uint8ArrayToString = require('uint8arrays/to-string')
const uint8ArrayConcat = require('uint8arrays/concat')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { toString: uint8ArrayToString } = require('uint8arrays/to-string')
const { concat: uint8ArrayConcat } = require('uint8arrays/concat')
const { fixtures } = require('./utils')
const { CID } = require('multiformats/cid')
const all = require('it-all')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/config/set.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { getDescribe, getIt, expect } = require('../utils/mocha')

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/dag/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const all = require('it-all')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const { CarReader } = require('@ipld/car')
const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const dagPb = require('@ipld/dag-pb')
const dagCbor = require('@ipld/dag-cbor')
const loadFixture = require('aegir/utils/fixtures')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/dag/get.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const dagPB = require('@ipld/dag-pb')
const dagCBOR = require('@ipld/dag-cbor')
const { importer } = require('ipfs-unixfs-importer')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/dag/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { sha256 } = require('multiformats/hashes/sha2')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const { CarWriter, CarReader } = require('@ipld/car')
const raw = require('multiformats/codecs/raw')
const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const loadFixture = require('aegir/utils/fixtures')

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/dag/put.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const dagCbor = require('@ipld/dag-cbor')
const { CID } = require('multiformats/cid')
const { sha256, sha512 } = require('multiformats/hashes/sha2')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/dag/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const dagPB = require('@ipld/dag-pb')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const testTimeout = require('../utils/test-timeout')
const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')

/**
* @typedef {import('ipfsd-ctl').Factory} Factory
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/dht/disabled.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict'

const { getDescribe, getIt, expect } = require('../utils/mocha')
const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')

/**
* @typedef {import('ipfsd-ctl').Factory} Factory
Expand Down
4 changes: 2 additions & 2 deletions packages/interface-ipfs-core/src/dht/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

const { getDescribe, getIt, expect } = require('../utils/mocha')
const testTimeout = require('../utils/test-timeout')
const uint8ArrayToString = require('uint8arrays/to-string')
const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { toString: uint8ArrayToString } = require('uint8arrays/to-string')

/**
* @typedef {import('ipfsd-ctl').Factory} Factory
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/dht/provide.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { CID } = require('multiformats/cid')
const all = require('it-all')
const { getDescribe, getIt, expect } = require('../utils/mocha')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/dht/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const { getDescribe, getIt, expect } = require('../utils/mocha')
const all = require('it-all')
const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')

/**
* @typedef {import('ipfsd-ctl').Factory} Factory
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/dht/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { CID } = require('multiformats/cid')
const { sha256 } = require('multiformats/hashes/sha2')

Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/files/chmod.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { nanoid } = require('nanoid')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const isShardAtPath = require('../utils/is-shard-at-path')
Expand Down
4 changes: 2 additions & 2 deletions packages/interface-ipfs-core/src/files/cp.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const uint8ArrayConcat = require('uint8arrays/concat')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { concat: uint8ArrayConcat } = require('uint8arrays/concat')
const { nanoid } = require('nanoid')
const all = require('it-all')
const { fixtures } = require('../utils')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/files/ls.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const { CID } = require('multiformats/cid')
const createShardedDirectory = require('../utils/create-sharded-directory')
Expand Down
4 changes: 2 additions & 2 deletions packages/interface-ipfs-core/src/files/mv.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const uint8ArrayConcat = require('uint8arrays/concat')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { concat: uint8ArrayConcat } = require('uint8arrays/concat')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const createShardedDirectory = require('../utils/create-sharded-directory')
const { randomBytes } = require('iso-random-stream')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/files/read.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayConcat = require('uint8arrays/concat')
const { concat: uint8ArrayConcat } = require('uint8arrays/concat')
const drain = require('it-drain')
const all = require('it-all')
const { fixtures } = require('../utils')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/files/stat.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { nanoid } = require('nanoid')
const { fixtures } = require('../utils')
const { getDescribe, getIt, expect } = require('../utils/mocha')
Expand Down
4 changes: 2 additions & 2 deletions packages/interface-ipfs-core/src/files/touch.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const uint8ArrayConcat = require('uint8arrays/concat')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { concat: uint8ArrayConcat } = require('uint8arrays/concat')
const { nanoid } = require('nanoid')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const delay = require('delay')
Expand Down
4 changes: 2 additions & 2 deletions packages/interface-ipfs-core/src/files/write.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const uint8ArrayConcat = require('uint8arrays/concat')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { concat: uint8ArrayConcat } = require('uint8arrays/concat')
const { nanoid } = require('nanoid')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const { isNode } = require('ipfs-utils/src/env')
Expand Down
6 changes: 3 additions & 3 deletions packages/interface-ipfs-core/src/get.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const uint8ArrayToString = require('uint8arrays/to-string')
const uint8ArrayConcat = require('uint8arrays/concat')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { toString: uint8ArrayToString } = require('uint8arrays/to-string')
const { concat: uint8ArrayConcat } = require('uint8arrays/concat')
const { fixtures } = require('./utils')
const { CID } = require('multiformats/cid')
const all = require('it-all')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/miscellaneous/resolve.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const isIpfs = require('is-ipfs')
const { nanoid } = require('nanoid')
const { base64url } = require('multiformats/bases/base64')
Expand Down
4 changes: 2 additions & 2 deletions packages/interface-ipfs-core/src/name-pubsub/pubsub.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const ipns = require('ipns')
const delay = require('delay')
const last = require('it-last')
const waitFor = require('../utils/wait-for')
const uint8ArrayToString = require('uint8arrays/to-string')
const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { toString: uint8ArrayToString } = require('uint8arrays/to-string')

const namespace = '/record/'
const ipfsRef = '/ipfs/QmPFVLPmp9zv5Z5KUqLhe2EivAGccQW2r7M7jhVJGLZoZU'
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/name/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict'

const { nanoid } = require('nanoid')
const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { fixture } = require('./utils')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const last = require('it-last')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/name/resolve.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const delay = require('delay')
const PeerId = require('peer-id')
Expand Down
4 changes: 2 additions & 2 deletions packages/interface-ipfs-core/src/name/utils.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'

const fromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')

exports.fixture = Object.freeze({
cid: 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP',
data: fromString('Plz add me!\n')
data: uint8ArrayFromString('Plz add me!\n')
})
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/object/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const { nanoid } = require('nanoid')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')

/**
* @typedef {import('ipfsd-ctl').Factory} Factory
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/object/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { nanoid } = require('nanoid')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const { UnixFS } = require('ipfs-unixfs')
const { randomBytes } = require('iso-random-stream')
const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { CID } = require('multiformats/cid')
const { sha256 } = require('multiformats/hashes/sha2')

Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/object/links.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const dagPB = require('@ipld/dag-pb')
const { nanoid } = require('nanoid')
const { CID } = require('multiformats/cid')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/object/patch/add-link.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const dagPB = require('@ipld/dag-pb')
const { CID } = require('multiformats/cid')
const { sha256 } = require('multiformats/hashes/sha2')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { getDescribe, getIt, expect } = require('../../utils/mocha')

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/object/patch/rm-link.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const dagPB = require('@ipld/dag-pb')
const { CID } = require('multiformats/cid')
const { sha256 } = require('multiformats/hashes/sha2')
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/object/patch/set-data.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */
'use strict'

const uint8ArrayFromString = require('uint8arrays/from-string')
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
const { getDescribe, getIt, expect } = require('../../utils/mocha')

/**
Expand Down
Loading