Skip to content

Commit

Permalink
fix: ignore undefined values in options (#173)
Browse files Browse the repository at this point in the history
Fixes a bug introduced in the cjs->esm switchover.
  • Loading branch information
achingbrain authored Sep 14, 2021
1 parent 0f9092e commit 200dff3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions packages/ipfs-unixfs-importer/src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import mergeOptions from 'merge-options'
import { sha256 } from 'multiformats/hashes/sha2'
import { murmur3128 } from '@multiformats/murmur3'

mergeOptions.bind({ ignoreUndefined: true })

/**
* @param {Uint8Array} buf
*/
Expand Down Expand Up @@ -61,5 +59,6 @@ const defaultOptions = {
* @returns {ImporterOptions}
*/
export default (options = {}) => {
return mergeOptions(defaultOptions, options)
const defaults = mergeOptions.bind({ ignoreUndefined: true })
return defaults(defaultOptions, options)
}
2 changes: 1 addition & 1 deletion packages/ipfs-unixfs/src/unixfs.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as $protobuf from "protobufjs";
import $protobuf from "protobufjs/minimal.js";
/** Properties of a Data. */
export interface IData {

Expand Down

0 comments on commit 200dff3

Please sign in to comment.