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

Commit 96b3909

Browse files
authoredMay 25, 2021
fix: remove optional chaining from code that will be transpiled (#3698)
Optional chaining is supported in node and in browsers but tools that transpile code to run in older browsers doesn't understand the syntax. Specifically the version of acorn that at least vue uses via a dependency on webpack 4 does not support this. It'll be fixed by them upgrading to webpack 5 but the timescale on that is unclear, which is why we're using a prerelease version in our examples. The short term fix is to just remove optional chaining from where we are using it in code that will be transpiled for browser use.
1 parent 8225bc8 commit 96b3909

File tree

1 file changed

+1
-1
lines changed
  • packages/ipfs-core/src/components/add-all

1 file changed

+1
-1
lines changed
 

‎packages/ipfs-core/src/components/add-all/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ function pinFile (pin, opts) {
189189
for await (const file of source) {
190190
// Pin a file if it is the root dir of a recursive add or the single file
191191
// of a direct add.
192-
const isRootDir = !file.path?.includes('/')
192+
const isRootDir = !(file.path && file.path.includes('/'))
193193
const shouldPin = (opts.pin == null ? true : opts.pin) && isRootDir && !opts.onlyHash
194194

195195
if (shouldPin) {

0 commit comments

Comments
 (0)
This repository has been archived.