Skip to content

Commit d566f4c

Browse files
committed
Removes commented code and correct camel case function name.
1 parent 4c3f1de commit d566f4c

File tree

1 file changed

+2
-70
lines changed

1 file changed

+2
-70
lines changed

lib/helpers.js

Lines changed: 2 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/*!
22
* Copyright (c) 2020-2024 Digital Bazaar, Inc. All rights reserved.
33
*/
4-
// import * as base58 from 'base58-universal';
5-
// import * as base64url from 'base64url-universal';
6-
import {renderToNfc, supportsNFC} from './nfcRenderer.js';
4+
import {renderToNfc, supportsNfc} from './nfcRenderer.js';
75
import {config} from '@bedrock/web';
86
import {
97
Ed25519VerificationKey2020
@@ -20,11 +18,6 @@ const supportedSignerTypes = new Map([
2018
]
2119
]);
2220

23-
// const multibaseDecoders = new Map([
24-
// ['u', base64url],
25-
// ['z', base58],
26-
// ]);
27-
2821
export async function createCapabilities({profileId, request}) {
2922
// TODO: validate `request`
3023

@@ -182,71 +175,10 @@ export async function toNFCPayload({credential}) {
182175
return renderToNfc({credential});
183176
}
184177

185-
// export async function toNFCPayload({credential}) {
186-
// const nfcRenderingTemplate2024 =
187-
// _getNFCRenderingTemplate2024({credential});
188-
// const bytes = await _decodeMultibase(nfcRenderingTemplate2024.payload);
189-
// return {bytes};
190-
// }
191-
192178
export function hasNFCPayload({credential}) {
193-
return supportsNFC({credential});
179+
return supportsNfc({credential});
194180
}
195181

196-
// export function hasNFCPayload({credential}) {
197-
// try {
198-
// const nfcRenderingTemplate2024 =
199-
// _getNFCRenderingTemplate2024({credential});
200-
// if(!nfcRenderingTemplate2024) {
201-
// return false;
202-
// }
203-
204-
// return true;
205-
// } catch(e) {
206-
// return false;
207-
// }
208-
// }
209-
210-
// function _getNFCRenderingTemplate2024({credential}) {
211-
// let {renderMethod} = credential;
212-
// if(!renderMethod) {
213-
// throw new Error('Credential does not contain "renderMethod".');
214-
// }
215-
216-
// renderMethod = Array.isArray(renderMethod) ? renderMethod : [renderMethod];
217-
218-
// let nfcRenderingTemplate2024 = null;
219-
// for(const rm of renderMethod) {
220-
// if(rm.type === 'NfcRenderingTemplate2024') {
221-
// nfcRenderingTemplate2024 = rm;
222-
// break;
223-
// }
224-
// continue;
225-
// }
226-
227-
// if(nfcRenderingTemplate2024 === null) {
228-
// throw new Error(
229-
// 'Credential does not support "NfcRenderingTemplate2024".');
230-
// }
231-
232-
// if(!nfcRenderingTemplate2024.payload) {
233-
// throw new Error('NfcRenderingTemplate2024 does not contain "payload".');
234-
// }
235-
236-
// return nfcRenderingTemplate2024;
237-
// }
238-
239-
// async function _decodeMultibase(input) {
240-
// const multibaseHeader = input[0];
241-
// const decoder = multibaseDecoders.get(multibaseHeader);
242-
// if(!decoder) {
243-
// throw new Error(`Multibase header "${multibaseHeader}" not supported.`);
244-
// }
245-
246-
// const encodedStr = input.slice(1);
247-
// return decoder.decode(encodedStr);
248-
// }
249-
250182
async function _updateProfileAgentUser({
251183
accessManager, profileAgent, profileAgentContent
252184
}) {

0 commit comments

Comments
 (0)