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

Commit 718ba9b

Browse files
committed
chore: do not add newlines to object data
1 parent 3820be0 commit 718ba9b

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/cli/commands/object/data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = {
1717
throw err
1818
}
1919

20-
print(data.toString())
20+
print(data.toString(), false)
2121
})
2222
}
2323
}

test/cli/object.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ describe('object', () => runOnAndOff((thing) => {
6464
})
6565
})
6666

67+
it('data with no newline', () => {
68+
return ipfs('object put test/fixtures/test-data/no-newline.json')
69+
.then((out) => expect(out).to.eql('added QmbBiaMqFHy2jNDxHSbwAgx6vWdP5cCYYQanzgT2x4jbCd\n'))
70+
.then(() => ipfs('object data QmbBiaMqFHy2jNDxHSbwAgx6vWdP5cCYYQanzgT2x4jbCd'))
71+
.then(out => expect(out).to.eql('another'))
72+
})
73+
6774
it('links', () => {
6875
return ipfs('object links QmZZmY4KCu9r3e7M2Pcn46Fc5qbn6NpzaAGaYb22kbfTqm').then((out) => {
6976
expect(out).to.eql(
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "Data": "another", "Links": [] }

0 commit comments

Comments
 (0)