Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit d28ea58

Browse files
author
Pedro Santos
committed
chore: code review changes
1 parent 48b82c9 commit d28ea58

File tree

8 files changed

+26
-22
lines changed

8 files changed

+26
-22
lines changed

SPEC/BLOCK.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const block = await ipfs.block.put(buf)
7575
console.log(block.data.toString())
7676
// Logs:
7777
// a serialized object
78-
console.log(block.cid.toBaseEncodedString())
78+
console.log(block.cid.toString())
7979
// Logs:
8080
// the CID of the object
8181

@@ -89,7 +89,7 @@ const block = await ipfs.block.put(blob, cid)
8989
console.log(block.data.toString())
9090
// Logs:
9191
// a serialized object
92-
console.log(block.cid.toBaseEncodedString())
92+
console.log(block.cid.toString())
9393
// Logs:
9494
// the CID of the object
9595
```

SPEC/DAG.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ _Explore the DAG API through interactive coding challenges in our ProtoSchool tu
4040
const obj = { simple: 'object' }
4141
const cid = await ipfs.dag.put(obj, { format: 'dag-cbor', hashAlg: 'sha3-512' })
4242

43-
console.log(cid.toBaseEncodedString())
43+
console.log(cid.toString())
4444
// zBwWX9ecx5F4X54WAjmFLErnBT6ByfNxStr5ovowTL7AhaUR98RWvXPS1V3HqV1qs3r5Ec5ocv7eCdbqYQREXNUfYNuKG
4545
```
4646

@@ -85,11 +85,11 @@ const obj = {
8585
}
8686

8787
const cid = await ipfs.dag.put(obj, { format: 'dag-cbor', hashAlg: 'sha2-256' })
88-
console.log(cid.toBaseEncodedString())
88+
console.log(cid.toString())
8989
// zdpuAmtur968yprkhG9N5Zxn6MFVoqAWBbhUAkNLJs2UtkTq5
9090

91-
async function getAndLog(cid) {
92-
const result = await ipfs.dag.get(cid)
91+
async function getAndLog(cidPath) {
92+
const result = await ipfs.dag.get(cidPath)
9393
console.log(result.value)
9494
}
9595

@@ -149,7 +149,7 @@ const obj = {
149149
}
150150

151151
const cid = await ipfs.dag.put(obj, { format: 'dag-cbor', hashAlg: 'sha2-256' })
152-
console.log(cid.toBaseEncodedString())
152+
console.log(cid.toString())
153153
// zdpuAmtur968yprkhG9N5Zxn6MFVoqAWBbhUAkNLJs2UtkTq5
154154

155155
const result = await ipfs.dag.tree('zdpuAmtur968yprkhG9N5Zxn6MFVoqAWBbhUAkNLJs2UtkTq5')

SPEC/KEY.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,6 @@ A great source of [examples][] can be found in the tests for this API.
148148

149149
> Export a key in a PEM encoded password protected PKCS #8
150150
151-
##### Go **NYI**
152-
153151
##### `ipfs.key.export(name, password)`
154152

155153
Where:
@@ -181,8 +179,6 @@ A great source of [examples][] can be found in the tests for this API.
181179

182180
> Import a PEM encoded password protected PKCS #8 key
183181
184-
##### Go **NYI**
185-
186182
##### `ipfs.key.import(name, pem, password)`
187183

188184
Where:

SPEC/MISCELLANEOUS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Where:
158158

159159
| Type | Description |
160160
| -------- | -------- |
161-
| `Promise<PullStream>` | A [`PullStream`][ps] of ping response objects |
161+
| `PullStream` | A [`PullStream`][ps] of ping response objects |
162162

163163
example of the returned objects:
164164

@@ -207,7 +207,7 @@ Where:
207207

208208
| Type | Description |
209209
| -------- | -------- |
210-
| `Promise<ReadableStream>` | A [`ReadableStream`][rs] of ping response objects |
210+
| `ReadableStream` | A [`ReadableStream`][rs] of ping response objects |
211211

212212
example of the returned objects:
213213

SPEC/OBJECT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const obj = {
6666
Links: []
6767
}
6868

69-
const cid = await ipfs.object.pu(obj)
69+
const cid = await ipfs.object.put(obj)
7070
console.log(cid.toString())
7171
// Logs:
7272
// QmPb5f92FxKPYdT3QNBd1GKiL4tZUXUrzF4Hkpdr3Gf1gK
@@ -160,7 +160,7 @@ A great source of [examples][] can be found in the tests for this API.
160160

161161
| Type | Description |
162162
| -------- | -------- |
163-
| `Promise<Array>` | An Array of [DAGLink](https://github.com/vijayee/js-ipfs-merkle-dag/blob/master/src/dag-node.js#L199-L203) objects |
163+
| `Promise<Array>` | An Array of [DAGLink](https://github.com/ipld/js-ipld-dag-pb/blob/master/src/dag-link/dagLink.js) objects |
164164

165165
**Example:**
166166

SPEC/PIN.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ an array of objects is returned, each of the form:
3333
**Example:**
3434

3535
```JavaScript
36-
const pinset = await ipfs.pin.add(hash)
36+
const pinset = await ipfs.pin.add('QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvs8u')
3737
console.log(pinset)
38+
// Logs:
39+
// [ { hash: 'QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvs8u' } ]
3840
```
3941

4042
A great source of [examples][] can be found in the tests for this API.
@@ -64,6 +66,12 @@ an array of objects with keys `hash` and `type` is returned.
6466
```JavaScript
6567
const pinset = await ipfs.pin.ls()
6668
console.log(pinset)
69+
// Logs
70+
// [
71+
// { hash: Qmc5XkteJdb337s7VwFBAGtiaoj2QCEzyxtNRy3iMudc3E, type: 'recursive' },
72+
// { hash: QmZbj5ruYneZb8FuR9wnLqJCpCXMQudhSdWhdhp5U1oPWJ, type: 'indirect' },
73+
// { hash: QmSo73bmN47gBxMNqbdV6rZ4KJiqaArqJ1nu5TvFhqqj1R, type: 'indirect' }
74+
// ]
6775
```
6876

6977
A great source of [examples][] can be found in the tests for this API.

SPEC/REFS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ for (const ref of refs) {
7272

7373
| Type | Description |
7474
| -------- | -------- |
75-
| `Promise<ReadableStream>` | A [Readable Stream][rs] representing the references |
75+
| `ReadableStream` | A [Readable Stream][rs] representing the references |
7676

7777
**Example:**
7878

@@ -99,7 +99,7 @@ stream.on('data', function (ref) {
9999

100100
| Type | Description |
101101
| -------- | -------- |
102-
| `Promise<PullStream>` | A [Pull Stream][ps] representing the references |
102+
| `PullStream` | A [Pull Stream][ps] representing the references |
103103

104104
**Example:**
105105

@@ -167,7 +167,7 @@ ipfs.refs.local(function (err, refs) {
167167

168168
| Type | Description |
169169
| -------- | -------- |
170-
| `Promise<ReadableStream>` | A [Readable Stream][rs] representing all the local references |
170+
| `ReadableStream` | A [Readable Stream][rs] representing all the local references |
171171

172172
**Example:**
173173

@@ -192,7 +192,7 @@ stream.on('data', function (ref) {
192192

193193
| Type | Description |
194194
| -------- | -------- |
195-
| `Promise<PullStream>` | A [Pull Stream][ps] representing all the local references |
195+
| `PullStream` | A [Pull Stream][ps] representing all the local references |
196196

197197
**Example:**
198198

SPEC/STATS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Options are described on [`ipfs.stats.bw`](#bw).
7171

7272
| Type | Description |
7373
| -------- | -------- |
74-
| `Promise<PullStream>` | A [Pull Stream][ps] representing IPFS bandwidth information |
74+
| `PullStream` | A [Pull Stream][ps] representing IPFS bandwidth information |
7575

7676
**Example:**
7777

@@ -108,7 +108,7 @@ Options are described on [`ipfs.stats.bw`](#bw).
108108

109109
| Type | Description |
110110
| -------- | -------- |
111-
| `Promise<ReadableStream>` | A [Readable Stream][rs] representing IPFS bandwidth information |
111+
| `ReadableStream` | A [Readable Stream][rs] representing IPFS bandwidth information |
112112

113113
**Example:**
114114

0 commit comments

Comments
 (0)