1- import path , { dirname } from 'node:path'
1+ import path from 'node:path'
22import { fileURLToPath } from 'node:url'
33import process from 'node:process'
44import toBase64 from 'btoa'
@@ -11,7 +11,7 @@ import yn from 'yn'
1111import is from '@sindresorhus/is'
1212import isDomainId from '../utils/is-domain-id.js'
1313
14- const directoryName = dirname ( fileURLToPath ( import . meta. url ) )
14+ const directoryName = path . dirname ( fileURLToPath ( import . meta. url ) )
1515
1616const { version} = await readPackage ( )
1717
@@ -59,9 +59,7 @@ export default async function postRoute(request, response) {
5959 // Return a vague error intentionally
6060 response
6161 . status ( 400 )
62- . send (
63- 'User already exists - to update values, please send a pull request on https://github.com/remy/mit-license' ,
64- )
62+ . send ( 'User already exists - to update values, please send a pull request on https://github.com/remy/mit-license' )
6563
6664 return
6765 }
@@ -70,9 +68,7 @@ export default async function postRoute(request, response) {
7068 if ( await pathExists ( path . join ( directoryName , '..' , 'users' , `${ id } .json` ) ) ) {
7169 response
7270 . status ( 409 )
73- . send (
74- 'User already exists - to update values, please send a pull request on https://github.com/remy/mit-license' ,
75- )
71+ . send ( 'User already exists - to update values, please send a pull request on https://github.com/remy/mit-license' )
7672 return
7773 }
7874
@@ -82,9 +78,7 @@ export default async function postRoute(request, response) {
8278 if ( is . undefined ( userData . gravatar ) ) {
8379 response
8480 . status ( 400 )
85- . send (
86- 'The "gravatar" JSON property must be a boolean.' ,
87- )
81+ . send ( 'The "gravatar" JSON property must be a boolean.' )
8882 return
8983 }
9084 }
@@ -116,8 +110,6 @@ export default async function postRoute(request, response) {
116110 } catch {
117111 response
118112 . status ( 500 )
119- . send (
120- 'Unable to create new user - please send a pull request on https://github.com/remy/mit-license' ,
121- )
113+ . send ( 'Unable to create new user - please send a pull request on https://github.com/remy/mit-license' )
122114 }
123115}
0 commit comments