Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

feat: convert to async/await #21

Merged
merged 11 commits into from May 17, 2019
Merged

feat: convert to async/await #21

merged 11 commits into from May 17, 2019

Conversation

achingbrain
Copy link
Collaborator

@achingbrain achingbrain commented Apr 25, 2019

Converts the importer to async/await

  • Shim pull-stream parts of the exporter with pull-stream-to-async-iterator
  • Convert tests to async/await
  • Remove any shims or pull-streams left

Requires ipfs-inactive/js-ipfs-unixfs-importer#24 to be merged.

@ghost ghost assigned achingbrain Apr 25, 2019
@ghost ghost added the in progress label Apr 25, 2019
@achingbrain
Copy link
Collaborator Author

Ref: ipfs/js-ipfs#1670

@achingbrain
Copy link
Collaborator Author

Closes #7

README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
```

### `maxDepth`
#### CBOR entries
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, interesting...

  • Does it already support this?
  • Does go-ipfs support this?
  • Given that this is a unixfs exporter should we be supporting these IPLD node types?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, through the object exporter.

I'm not sure what go does.

The name starts to become misleading, true - might be worth turning it into a ipfs-exporter, though it's really an ipld-exporter with some baked in assumptions about dag-pb nodes? Not sure.

src/resolvers/raw.js Show resolved Hide resolved
const validateOffsetAndLength = require('../utils/validate-offset-and-length')

const rawContent = (node) => {
return function * (options = {}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend not to use this feature because it only works when undefined is passed and I usually also want to allow null to be passed (or any other falsey value really) so I end up doing the old options = options || {}. Kinda preference but also flexibility for the caller 🤷‍♀️

src/resolvers/raw.js Show resolved Hide resolved
src/resolvers/unixfs-v1/content/hamt-sharded-directory.js Outdated Show resolved Hide resolved
src/resolvers/unixfs-v1/index.js Outdated Show resolved Hide resolved
@achingbrain achingbrain merged commit 7119a09 into master May 17, 2019
@achingbrain achingbrain deleted the async-await branch May 17, 2019 11:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants