ipfs-unixfs-importer
Advanced tools
Comparing version 2.0.2-rc.2 to 2.0.2-rc.3
{ | ||
"name": "ipfs-unixfs-importer", | ||
"version": "2.0.2-rc.2+5ffa2b3", | ||
"version": "2.0.2-rc.3+db60a42", | ||
"description": "JavaScript implementation of the UnixFs importer used by IPFS", | ||
@@ -38,3 +38,4 @@ "leadMaintainer": "Alex Potsides <alex.potsides@protocol.ai>", | ||
"devDependencies": { | ||
"aegir": "^22.0.0", | ||
"aegir": "^25.0.0", | ||
"buffer": "^5.6.0", | ||
"chai": "^4.2.0", | ||
@@ -44,5 +45,5 @@ "cids": "^0.8.0", | ||
"dirty-chai": "^2.0.1", | ||
"ipfs-unixfs-exporter": "^2.0.2-rc.2+5ffa2b3", | ||
"ipfs-unixfs-exporter": "^2.0.2-rc.3+db60a42", | ||
"ipld": "^0.26.1", | ||
"ipld-in-memory": "^4.0.0", | ||
"ipld-in-memory": "^5.0.0", | ||
"it-buffer-stream": "^1.0.2", | ||
@@ -57,6 +58,6 @@ "it-last": "^1.0.1", | ||
"bl": "^4.0.0", | ||
"buffer": "^5.6.0", | ||
"err-code": "^2.0.0", | ||
"hamt-sharding": "^1.0.0", | ||
"ipfs-unixfs": "^1.0.2", | ||
"ipfs-unixfs": "^1.0.3-rc.3+db60a42", | ||
"ipfs-utils": "^2.3.1", | ||
"ipld-dag-pb": "^0.19.0", | ||
@@ -68,6 +69,6 @@ "it-all": "^1.0.1", | ||
"merge-options": "^2.0.0", | ||
"multihashing-async": "^0.8.0", | ||
"multihashing-async": "^1.0.0", | ||
"rabin-wasm": "^0.1.1" | ||
}, | ||
"gitHead": "5ffa2b38ef28f1a29ee2deb0792b904415bc10ee" | ||
"gitHead": "db60a4232e600e73227e6ab8964be083eada389a" | ||
} |
'use strict' | ||
const errCode = require('err-code') | ||
const { Buffer } = require('buffer') | ||
const utf8Encoder = require('../utils/utf8-encoder') | ||
@@ -14,5 +14,5 @@ // make sure the content only emits buffer-a-likes | ||
if (typeof content === 'string' || content instanceof String) { | ||
yield Buffer.from(content, 'utf8') | ||
yield utf8Encoder.encode(content) | ||
} else if (Array.isArray(content)) { | ||
yield Buffer.from(content) | ||
yield Uint8Array.from(content) | ||
} else { | ||
@@ -19,0 +19,0 @@ yield content |
@@ -7,3 +7,2 @@ 'use strict' | ||
} = require('ipld-dag-pb') | ||
const { Buffer } = require('buffer') | ||
const UnixFS = require('ipfs-unixfs') | ||
@@ -15,5 +14,7 @@ const multihashing = require('multihashing-async') | ||
const mergeOptions = require('merge-options').bind({ ignoreUndefined: true }) | ||
const utf8Encoder = require('./utils/utf8-encoder') | ||
const hashFn = async function (value) { | ||
const hash = await multihashing(Buffer.from(value, 'utf8'), 'murmur3-128') | ||
const buf = utf8Encoder.encode(value) | ||
const hash = await multihashing(buf, 'murmur3-128') | ||
@@ -26,3 +27,3 @@ // Multihashing inserts preamble of 2 bytes. Remove it. | ||
const length = justHash.length | ||
const result = Buffer.alloc(length) | ||
const result = new Uint8Array(length) | ||
// TODO: invert buffer because that's how Go impl does it | ||
@@ -148,3 +149,3 @@ for (let i = 0; i < length; i++) { | ||
// reverse the bit field before storing it | ||
const data = Buffer.from(children.bitField().reverse()) | ||
const data = Uint8Array.from(children.bitField().reverse()) | ||
const dir = new UnixFS({ | ||
@@ -151,0 +152,0 @@ type: 'hamt-sharded-directory', |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
22663105
85
3413
15
+ Addedipfs-utils@^2.3.1
+ Addedabort-controller@3.0.0(transitive)
+ Addedany-signal@1.2.0(transitive)
+ Addedat-least-node@1.0.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedevent-target-shim@5.0.1(transitive)
+ Addedfast-fifo@1.3.2(transitive)
+ Addedfs-extra@8.1.09.1.0(transitive)
+ Addedget-iterator@1.0.2(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedipfs-utils@2.4.0(transitive)
+ Addedis-electron@2.2.2(transitive)
+ Addediso-url@0.4.7(transitive)
+ Addedit-glob@0.0.8(transitive)
+ Addedit-to-stream@0.1.2(transitive)
+ Addedjsonfile@4.0.06.1.0(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addednanoid@3.3.8(transitive)
+ Addedp-defer@3.0.0(transitive)
+ Addedp-fifo@1.0.0(transitive)
+ Addedstream-to-it@0.2.4(transitive)
+ Addeduniversalify@0.1.22.0.1(transitive)
- Removedbuffer@^5.6.0
- Removedmultihashing-async@0.8.2(transitive)
Updatedmultihashing-async@^1.0.0