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

[Types] DAGAPI get requires CID but should also be string|Uint8Array? #3637

Closed
rvagg opened this issue Apr 26, 2021 · 1 comment · Fixed by #3675
Closed

[Types] DAGAPI get requires CID but should also be string|Uint8Array? #3637

rvagg opened this issue Apr 26, 2021 · 1 comment · Fixed by #3675
Assignees
Labels
need/triage Needs initial labeling and prioritization

Comments

@rvagg
Copy link
Member

rvagg commented Apr 26, 2021

Ref: ceramicnetwork/js-ceramic#1194 (comment)

get: (cid: CID, options?: GetOptions & OptionExtension) => Promise<GetResult>

->

/**
* @type {import('ipfs-core-types/src/dag').API["get"]}
*/
const get = async function get (ipfsPath, options = {}) {
const {
cid,
path
} = toCidAndPath(ipfsPath)

But toCidAndPath() still allows string and Uint8Array:

/**
* @param {string|Uint8Array|CID} string
* @returns {{cid:CID, path?:string}}
*/
const toCidAndPath = (string) => {

@rvagg rvagg added the need/triage Needs initial labeling and prioritization label Apr 26, 2021
achingbrain added a commit that referenced this issue May 6, 2021
If you have a path within the DAG to resolve, pass it as `path` in
the options object as per the documentation.

Fixes #3637
achingbrain added a commit that referenced this issue May 6, 2021
If you have a path within the DAG to resolve, pass it as `path` in
the options object as per the documentation.

Fixes #3637
@ipfs ipfs deleted a comment from welcome bot May 6, 2021
achingbrain added a commit that referenced this issue May 7, 2021
If you have a path within the DAG to resolve, pass it as `path` in the options object.

Makes the API conform to the documentation.

Fixes #3637
@CSDUMMI
Copy link
Contributor

CSDUMMI commented May 16, 2021

What is the problem here? Why do you have to remove string support?
By the issues, I cannot gather any reason for this change and it causes
errors in orbit-db.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants