From a6d0f3d7251472d4c29d6f6a549135d7a01e72f6 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Sat, 17 Feb 2024 16:59:40 -0800 Subject: [PATCH] lint --- lib/group.js | 1 - lib/mysql.js | 1 + lib/session.js | 1 - lib/user.js | 1 - lib/util.js | 3 ++- test/.setup.js | 1 - 6 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/group.js b/lib/group.js index 93ed4d0..4bc2e7e 100644 --- a/lib/group.js +++ b/lib/group.js @@ -1,6 +1,5 @@ const mysql = require('./mysql') -const util = require('./util') const validate = require('@nictool/nt-validate') class Group { diff --git a/lib/mysql.js b/lib/mysql.js index ab7b729..4a56462 100644 --- a/lib/mysql.js +++ b/lib/mysql.js @@ -2,6 +2,7 @@ const mysql = require('mysql2/promise') const util = require('./util') +util.setEnv() const config = require('./config') class MySQL { diff --git a/lib/session.js b/lib/session.js index 15e8102..190ac49 100644 --- a/lib/session.js +++ b/lib/session.js @@ -1,7 +1,6 @@ // const crypto = require('crypto') // const { createHmac, pbkdf2 } = require('node:crypto') -const util = require('./util') const Mysql = require('./mysql') // const User = require('./user') diff --git a/lib/user.js b/lib/user.js index 5e6a53d..c2ce2ce 100644 --- a/lib/user.js +++ b/lib/user.js @@ -1,7 +1,6 @@ // const crypto = require('crypto') const { createHmac, pbkdf2 } = require('node:crypto') -const util = require('./util') const mysql = require('./mysql') const validate = require('@nictool/nt-validate') diff --git a/lib/util.js b/lib/util.js index c4a3ee8..2096c55 100644 --- a/lib/util.js +++ b/lib/util.js @@ -1,5 +1,6 @@ +exports.setEnv = () => { + if (process.env.NODE_ENV !== undefined) return -if (process.env.NODE_ENV === undefined) { switch (require('os').hostname()) { case 'mbp.simerson.net': case 'imac27.simerson.net': diff --git a/test/.setup.js b/test/.setup.js index 90f0a31..f95c009 100644 --- a/test/.setup.js +++ b/test/.setup.js @@ -1,4 +1,3 @@ - const util = require('../lib/util') const group = require('../lib/group') // const session = require('../lib/session')