Skip to content

Commit 6f4fc1c

Browse files
committed
chore: format
1 parent b1fb3a9 commit 6f4fc1c

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

lib/zone_record.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ function unApplyMap(obj, map) {
165165
const [algo, flags, iters, salt, bitmaps, next] = obj.address
166166
.slice(1, -1)
167167
.split("','")
168-
obj['hash algorithm'] = /^\d+$/.test(algo) ? parseInt(algo) : algo ?? ''
169-
obj.flags = /^\d+$/.test(flags) ? parseInt(flags) : flags ?? ''
170-
obj.iterations = /^\d+$/.test(iters) ? parseInt(iters) : iters ?? ''
168+
obj['hash algorithm'] = /^\d+$/.test(algo) ? parseInt(algo) : (algo ?? '')
169+
obj.flags = /^\d+$/.test(flags) ? parseInt(flags) : (flags ?? '')
170+
obj.iterations = /^\d+$/.test(iters) ? parseInt(iters) : (iters ?? '')
171171
obj.salt = salt
172172
obj['type bit maps'] = bitmaps
173173
obj['next hashed owner name'] = next
@@ -176,9 +176,9 @@ function unApplyMap(obj, map) {
176176
}
177177
if (obj.type === 'NSEC3PARAM') {
178178
const [algo, flags, iters, salt] = obj.address.slice(1, -1).split("','")
179-
obj['hash algorithm'] = /^\d+$/.test(algo) ? parseInt(algo) : algo ?? ''
180-
obj.flags = /^\d+$/.test(flags) ? parseInt(flags) : flags ?? ''
181-
obj.iterations = /^\d+$/.test(iters) ? parseInt(iters) : iters ?? ''
179+
obj['hash algorithm'] = /^\d+$/.test(algo) ? parseInt(algo) : (algo ?? '')
180+
obj.flags = /^\d+$/.test(flags) ? parseInt(flags) : (flags ?? '')
181+
obj.iterations = /^\d+$/.test(iters) ? parseInt(iters) : (iters ?? '')
182182
obj.salt = salt
183183
delete obj.address
184184
delete map.address

routes/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import path from 'node:path'
44
import url from 'node:url'
55

6-
import Jwt from '@hapi/jwt'
6+
import Jwt from '@hapi/jwt'
77
import Hapi from '@hapi/hapi'
88
// import Cookie from '@hapi/cookie'
99
import Inert from '@hapi/inert'
@@ -38,7 +38,7 @@ async function setup() {
3838
parser: (query) => qs.parse(query),
3939
},
4040
routes: {
41-
"cors": true,
41+
cors: true,
4242
files: {
4343
relativeTo: path.join(
4444
path.dirname(url.fileURLToPath(import.meta.url)),
@@ -73,7 +73,7 @@ async function setup() {
7373
nbf: true,
7474
exp: true,
7575
maxAgeSec: 14400, // 4 hours
76-
timeSkewSec: 15
76+
timeSkewSec: 15,
7777
},
7878
httpAuthScheme: 'Bearer',
7979
headerName: 'authorization',
@@ -82,10 +82,10 @@ async function setup() {
8282
isValid: true,
8383
credentials: artifacts.decoded.payload.nt,
8484
}
85-
}
85+
},
8686
})
8787

88-
server.auth.default('nt_jwt_strategy');
88+
server.auth.default('nt_jwt_strategy')
8989

9090
server.route({
9191
method: 'GET',
@@ -113,7 +113,9 @@ async function setup() {
113113

114114
server.events.on('request', (request, event, tags) => {
115115
if (tags.error) {
116-
console.error(`Request ${event.request} error: ${event.error ? event.error.message : 'unknown'}`);
116+
console.error(
117+
`Request ${event.request} error: ${event.error ? event.error.message : 'unknown'}`,
118+
)
117119
}
118120
})
119121

routes/permission.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ function PermissionRoutes(server) {
2020
tags: ['api'],
2121
},
2222
handler: async (request, h) => {
23-
2423
const getArgs = {
2524
deleted: request.query.deleted === true ? 1 : 0,
2625
id: parseInt(request.params.id, 10),

routes/session.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import validate from '@nictool/validate'
22

33
import Config from '../lib/config.js'
4-
import Jwt from '@hapi/jwt'
4+
import Jwt from '@hapi/jwt'
55

66
import User from '../lib/user.js'
77
import Session from '../lib/session.js'
@@ -75,16 +75,16 @@ function SessionRoutes(server) {
7575
user: account.user,
7676
group: account.group,
7777
session: { id: sessId },
78-
}
78+
},
7979
},
8080
{
8181
key: httpCfg.jwt.key,
8282
algorithm: 'HS512',
8383
},
8484
{
85-
ttlSec: 28800 // 8 hours
86-
}
87-
);
85+
ttlSec: 28800, // 8 hours
86+
},
87+
)
8888

8989
return h
9090
.response({
@@ -114,7 +114,6 @@ function SessionRoutes(server) {
114114
tags: ['api'],
115115
},
116116
handler: async (request, h) => {
117-
118117
const { user, group, session } = h.request.auth.credentials
119118

120119
const bool = await Session.delete({

routes/test/zone.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
"ttl": 3601,
1313
"location": "",
1414
"last_publish": null
15-
}
15+
}

0 commit comments

Comments
 (0)