mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-22 01:43:29 +01:00
bump libs (#211)
This commit is contained in:
10
src/burn.ts
10
src/burn.ts
@@ -1,6 +1,8 @@
|
||||
import _ from "underscore";
|
||||
import { createUrnUtil } from "urn-lib";
|
||||
import randomstring from "randomstring";
|
||||
import { pipe } from "fp-ts/lib/function";
|
||||
import { either as E } from "fp-ts";
|
||||
|
||||
import jwsEncryption from "./encryption";
|
||||
|
||||
@@ -78,7 +80,13 @@ export const parse = (burn: string): BUrn => {
|
||||
resource: result.resource as string,
|
||||
};
|
||||
if(x.system == "encrypted") {
|
||||
return parse(encryptor.decrypt(x.resource));
|
||||
return pipe(
|
||||
encryptor.decrypt(x.resource),
|
||||
E.match(
|
||||
(err) => { throw new Error(err) },
|
||||
(z) => parse(z)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
return x;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user