migrate to "export default"
also, set no-use-before-define in linter
This commit is contained in:
+11
-10
@@ -1,19 +1,11 @@
|
||||
import assert from 'node:assert';
|
||||
import BoxError from './boxerror.js';
|
||||
import crypto from 'node:crypto';
|
||||
import * as database from './database.js';
|
||||
import database from './database.js';
|
||||
import hat from './hat.js';
|
||||
import safe from 'safetydance';
|
||||
import * as _ from './underscore.js';
|
||||
import _ from './underscore.js';
|
||||
|
||||
export {
|
||||
get,
|
||||
add,
|
||||
list,
|
||||
del,
|
||||
|
||||
removePrivateFields
|
||||
};
|
||||
|
||||
const APP_PASSWORD_FIELDS = [ 'id', 'name', 'userId', 'identifier', 'hashedPassword', 'creationTime', 'expiresAt' ].join(',');
|
||||
|
||||
@@ -85,3 +77,12 @@ async function del(id) {
|
||||
const result = await database.query('DELETE FROM appPasswords WHERE id = ?', [ id ]);
|
||||
if (result.affectedRows !== 1) throw new BoxError(BoxError.NOT_FOUND, 'password not found');
|
||||
}
|
||||
|
||||
export default {
|
||||
get,
|
||||
add,
|
||||
list,
|
||||
del,
|
||||
|
||||
removePrivateFields
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user