3id-resolver
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -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') |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
20726
363
55
0