This commit is contained in:
syuilo
2021-12-09 23:58:30 +09:00
parent 0abe2dfee0
commit c69b72e199
573 changed files with 3318 additions and 3318 deletions

View File

@@ -20,7 +20,7 @@ export class LdSignature {
creator,
domain,
nonce: crypto.randomBytes(16).toString('hex'),
created: (created || new Date()).toISOString()
created: (created || new Date()).toISOString(),
} as {
type: string;
creator: string;
@@ -45,8 +45,8 @@ export class LdSignature {
...data,
signature: {
...options,
signatureValue: signature.toString('base64')
}
signatureValue: signature.toString('base64'),
},
};
}
@@ -60,7 +60,7 @@ export class LdSignature {
public async createVerifyData(data: any, options: any) {
const transformedOptions = {
...options,
'@context': 'https://w3id.org/identity/v1'
'@context': 'https://w3id.org/identity/v1',
};
delete transformedOptions['type'];
delete transformedOptions['id'];
@@ -79,7 +79,7 @@ export class LdSignature {
public async normalize(data: any) {
const customLoader = this.getLoader();
return await jsonld.normalize(data, {
documentLoader: customLoader
documentLoader: customLoader,
});
}
@@ -93,7 +93,7 @@ export class LdSignature {
return {
contextUrl: null,
document: CONTEXTS[url],
documentUrl: url
documentUrl: url,
};
}
}
@@ -103,7 +103,7 @@ export class LdSignature {
return {
contextUrl: null,
document: document,
documentUrl: url
documentUrl: url,
};
};
}