Skip to content

Commit db3dcd1

Browse files
committed
chore: pull text encoder from ipfs-utils
1 parent 0c0b1ee commit db3dcd1

File tree

9 files changed

+784
-963
lines changed

9 files changed

+784
-963
lines changed

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"lerna": "3.20.2",
2+
"lerna": "3.22.1",
33
"packages": [
44
"packages/*"
55
],

package-lock.json

+776-459
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"update-contributors": "aegir release --lint=false --test=false --bump=false --build=false --changelog=false --commit=false --tag=false --push=false --ghrelease=false --docs=false --publish=false"
2020
},
2121
"devDependencies": {
22-
"lerna": "^3.20.2"
22+
"lerna": "^3.22.1"
2323
},
2424
"repository": {
2525
"type": "git",

packages/ipfs-unixfs-exporter/package-lock.json

-501
This file was deleted.

packages/ipfs-unixfs-exporter/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"err-code": "^2.0.0",
5959
"hamt-sharding": "^1.0.0",
6060
"ipfs-unixfs": "^1.0.2",
61+
"ipfs-utils": "^2.3.1",
6162
"it-last": "^1.0.1",
6263
"multihashing-async": "^1.0.0"
6364
}

packages/ipfs-unixfs-exporter/src/utils/find-cid-in-shard.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
const Bucket = require('hamt-sharding/src/bucket')
44
const multihashing = require('multihashing-async')
5+
const TextEncoder = require('ipfs-utils/src/text-encoder')
56

67
// FIXME: this is copy/pasted from ipfs-unixfs-importer/src/dir-sharded.js
78
const hashFn = async function (value) {
8-
const buf = new TextEncoder('utf-8').encode(value)
9+
const buf = new TextEncoder('utf8').encode(value)
910
const hash = await multihashing(buf, 'murmur3-128')
1011

1112
// Multihashing inserts preamble of 2 bytes. Remove it.

packages/ipfs-unixfs-importer/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"err-code": "^2.0.0",
5757
"hamt-sharding": "^1.0.0",
5858
"ipfs-unixfs": "^1.0.2",
59+
"ipfs-utils": "^2.3.1",
5960
"ipld-dag-pb": "^0.19.0",
6061
"it-all": "^1.0.1",
6162
"it-batch": "^1.0.3",

packages/ipfs-unixfs-importer/src/dag-builder/validate-chunks.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict'
22

33
const errCode = require('err-code')
4+
const TextEncoder = require('ipfs-utils/src/text-encoder')
45

56
// make sure the content only emits buffer-a-likes
67
async function * validateChunks (source) {

packages/ipfs-unixfs-importer/src/dir-sharded.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const Dir = require('./dir')
1010
const persist = require('./utils/persist')
1111
const Bucket = require('hamt-sharding')
1212
const mergeOptions = require('merge-options').bind({ ignoreUndefined: true })
13+
const TextEncoder = require('ipfs-utils/src/text-encoder')
1314

1415
const hashFn = async function (value) {
1516
const buf = new TextEncoder('utf-8').encode(value)

0 commit comments

Comments
 (0)