migrate to "export default"

also, set no-use-before-define in linter
This commit is contained in:
Girish Ramakrishnan
2026-02-14 15:43:24 +01:00
parent ddb46646fa
commit 36aa641cb9
231 changed files with 2846 additions and 2728 deletions
+19 -18
View File
@@ -1,8 +1,8 @@
import assert from 'node:assert';
import BoxError from './boxerror.js';
import crypto from 'node:crypto';
import * as dashboard from './dashboard.js';
import * as database from './database.js';
import dashboard from './dashboard.js';
import database from './database.js';
import debugModule from 'debug';
import safe from 'safetydance';
import {
@@ -11,25 +11,10 @@ import {
generateAuthenticationOptions as generateWebAuthnAuthenticationOptions,
verifyAuthenticationResponse
} from '@simplewebauthn/server';
import * as _ from './underscore.js';
import _ from './underscore.js';
const debug = debugModule('box:passkeys');
export {
list,
get,
getByCredentialId,
add,
del,
updateCounter,
generateRegistrationOptions,
verifyRegistration,
generateAuthenticationOptions,
verifyAuthentication,
removePrivateFields
};
const PASSKEY_FIELDS = [ 'id', 'userId', 'credentialId', 'publicKey', 'counter', 'transports', 'name', 'creationTime', 'lastUsedTime' ].join(',');
@@ -314,3 +299,19 @@ async function verifyAuthentication(user, response) {
return { verified: true, passkeyId: passkey.id };
}
export default {
list,
get,
getByCredentialId,
add,
del,
updateCounter,
generateRegistrationOptions,
verifyRegistration,
generateAuthenticationOptions,
verifyAuthentication,
removePrivateFields
};