Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ipfs-api

Package Overview
Dependencies
Maintainers
5
Versions
177
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipfs-api - npm Package Compare versions

Comparing version 2.6.2 to 2.7.0

2

package.json
{
"name": "ipfs-api",
"version": "2.6.2",
"version": "2.7.0",
"description": "A client library for the IPFS API",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -136,3 +136,6 @@ var multiaddr = require('multiaddr')

stat: argCommand('object/stat'),
links: argCommand('object/links')
links: argCommand('object/links'),
patch: function (file, opts, cb) {
return requestAPI('object/patch', [file].concat(opts), null, null, cb)
}
}

@@ -139,0 +142,0 @@

@@ -369,6 +369,6 @@ /* global describe it before */

describe('.object', function () {
var testObject =
Buffer(JSON.stringify({Data: 'testdata', Links: []}))
var testObjectHash =
'QmPTkMuuL6PD8L2SwTwbcs1NPg14U8mRzerB1ZrrBrkSDD'
var testObject = Buffer(JSON.stringify({Data: 'testdata', Links: []}))
var testObjectHash = 'QmPTkMuuL6PD8L2SwTwbcs1NPg14U8mRzerB1ZrrBrkSDD'
var testPatchObject = Buffer(JSON.stringify({Data: 'new test data'}))
var testPatchObjectHash = 'QmWJDtdQWQSajQPx1UVAGWKaSGrHVWdjnrNhbooHP7LuF2'

@@ -452,2 +452,35 @@ it('object.put', function (done) {

})
it('object.patch', function (done) {
this.timeout(10000)
apiClients['a'].object.put(testPatchObject, 'json', function (err, res) {
if (err) {
throw err
}
apiClients['a'].object.patch(testObjectHash, ['add-link', 'next', testPatchObjectHash], function (err, res) {
if (err) {
throw err
}
var o = JSON.parse(res)
assert.deepEqual(o, {
Hash: 'QmZFdJ3CQsY4kkyQtjoUo8oAzsEs5BNguxBhp8sjQMpgkd',
Links: null
})
apiClients['a'].object.get(o.Hash, function (err, res) {
if (err) {
throw err
}
assert.deepEqual(JSON.parse(res), {
Data: 'testdata',
Links: [{
Name: 'next',
Hash: 'QmWJDtdQWQSajQPx1UVAGWKaSGrHVWdjnrNhbooHP7LuF2',
Size: 15
}]
})
done()
})
})
})
})
})

@@ -454,0 +487,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc