fix(try): ld signature normalizer (#9758)

This commit is contained in:
Nya Candy 2023-01-31 18:37:39 +08:00 committed by GitHub
parent 5b38f76254
commit 00d28826b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,6 @@
import * as crypto from 'node:crypto';
import { Inject, Injectable } from '@nestjs/common';
import jsonld from 'jsonld';
import { HttpRequestService } from '@/core/HttpRequestService.js';
import { bindThis } from '@/decorators.js';
import { CONTEXTS } from './misc/contexts.js';
@ -84,7 +85,9 @@ class LdSignature {
@bindThis
public async normalize(data: any) {
const customLoader = this.getLoader();
return 42;
return await jsonld.normalize(data, {
documentLoader: customLoader,
});
}
@bindThis