Socket
Socket
Sign inDemoInstall

3id-resolver

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

3id-resolver - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

26

lib/resolver.js

@@ -160,3 +160,3 @@ "use strict";

case 18:
_context.next = 30;
_context.next = 31;
break;

@@ -168,20 +168,26 @@

_context.prev = 22;
_context.next = 25;
if (!pin) {
_context.next = 26;
break;
}
_context.next = 26;
return ipfs.pin.rm(cid);
case 25:
_context.next = 29;
case 26:
_context.next = 30;
break;
case 27:
_context.prev = 27;
case 28:
_context.prev = 28;
_context.t1 = _context["catch"](22);
case 29:
case 30:
throw new Error('Invalid 3ID');
case 30:
case 31:
return _context.abrupt("return", doc);
case 31:
case 32:
case "end":

@@ -191,3 +197,3 @@ return _context.stop();

}
}, _callee, null, [[1, 20], [22, 27]]);
}, _callee, null, [[1, 20], [22, 28]]);
}));

@@ -194,0 +200,0 @@ return _resolve3.apply(this, arguments);

{
"name": "3id-resolver",
"version": "1.0.0",
"version": "1.0.1",
"description": "Resolve 3ID documents",

@@ -33,3 +33,3 @@ "main": "lib/resolver.js",

"babel-core": "7.0.0-bridge.0",
"ipfs": "^0.40.0",
"ipfs": "^0.44.0",
"jest": "^22.4.0",

@@ -36,0 +36,0 @@ "regenerator-runtime": "^0.11.1",

@@ -53,1 +53,3 @@ # 3ID Resolver

## Maintainers
[@oed](https://github.com/oed)

@@ -56,3 +56,3 @@ import { Resolver } from 'did-resolver'

rootCID = cid
await expect(ipfs.pin.ls(cid)).rejects.toMatchSnapshot()
await expect(ipfs.pin.ls(cid).next()).rejects.toMatchSnapshot()
})

@@ -64,3 +64,4 @@

await resolver2.resolve(rootDID)
expect((await ipfs.pin.ls(rootCID))[0].hash).toEqual(rootCID.toString())
const pinnedCid = (await ipfs.pin.ls(rootCID).next()).value.cid
expect(pinnedCid.toString()).toEqual(rootCID.toString())
await ipfs.pin.rm(rootCID)

@@ -118,3 +119,3 @@ })

await expect(resolver.resolve(doc.DID)).resolves.toMatchSnapshot()
await expect(ipfs.pin.ls(cid)).rejects.toMatchSnapshot()
await expect(ipfs.pin.ls(cid).next()).rejects.toMatchSnapshot()
})

@@ -126,4 +127,6 @@

await resolver2.resolve(subDID)
expect((await ipfs.pin.ls(rootCID))[0].hash).toEqual(rootCID.toString())
expect((await ipfs.pin.ls(subCID))[0].hash).toEqual(subCID.toString())
const pinnedCid1 = (await ipfs.pin.ls(rootCID).next()).value.cid
expect(pinnedCid1.toString()).toEqual(rootCID.toString())
const pinnedCid2 = (await ipfs.pin.ls(subCID).next()).value.cid
expect(pinnedCid2.toString()).toEqual(subCID.toString())
})

@@ -130,0 +133,0 @@ })

@@ -64,3 +64,3 @@ import { verifyJWT } from 'did-jwt'

try {
await ipfs.pin.rm(cid)
if (pin) await ipfs.pin.rm(cid)
} catch (e) {}

@@ -67,0 +67,0 @@ throw new Error('Invalid 3ID')

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