From ea02e6d2ba3f4c131d6a2777d88e39214f37728f Mon Sep 17 00:00:00 2001 From: nh602 Date: Mon, 13 Nov 2023 20:56:36 +0000 Subject: [PATCH 1/3] Added backend linter and ran lint-fix --- backend/.eslintrc.js | 26 + backend/controllers/VendorController.js | 214 ++-- backend/database.js | 15 +- backend/index.js | 36 +- backend/middleware/successResponse.js | 19 +- backend/package-lock.json | 1262 ++++++++++++++++++++++- backend/package.json | 11 +- backend/routes/VendorRouter.js | 15 +- 8 files changed, 1428 insertions(+), 170 deletions(-) create mode 100644 backend/.eslintrc.js diff --git a/backend/.eslintrc.js b/backend/.eslintrc.js new file mode 100644 index 0000000..d4bbcce --- /dev/null +++ b/backend/.eslintrc.js @@ -0,0 +1,26 @@ +module.exports = { + env: { + browser: true, + commonjs: true, + es2021: true, + }, + extends: 'google', + overrides: [ + { + env: { + node: true, + }, + files: [ + '.eslintrc.{js,cjs}', + ], + parserOptions: { + sourceType: 'script', + }, + }, + ], + parserOptions: { + ecmaVersion: 'latest', + }, + rules: { + }, +}; diff --git a/backend/controllers/VendorController.js b/backend/controllers/VendorController.js index ec8abaf..81b93dc 100644 --- a/backend/controllers/VendorController.js +++ b/backend/controllers/VendorController.js @@ -1,142 +1,148 @@ const express = require('express'); const db = require('../database'); -var { hash, genSalt } = require('bcryptjs'); +const {hash, genSalt} = require('bcryptjs'); const bcrypt = require('bcryptjs'); const getVendor = async (req, res, next) => { - try { - const data = await db.oneOrNone('SELECT * FROM Vendors WHERE email = $1', [req.body.email]); - if (data) { - res.locals.data = data; - next(); - } else { - res.status(401).json({ message: "Email does not exist." }); - } - } catch (err) { - console.error(err); - res.status(500).json({ error: "Internal Server Error" }); + try { + const data = await db.oneOrNone( + 'SELECT * FROM Vendors WHERE email = $1', + [req.body.email], + ); + + if (data) { + res.locals.data = data; + next(); + } else { + res.status(401).json({message: 'Email does not exist.'}); } + } catch (err) { + console.error(err); + res.status(500).json({error: 'Internal Server Error'}); + } }; // Middleware to authenticate the vendor const authenticateVendor = async (req, res, next) => { - try { - const vendor = res.locals.data; - const match = await bcrypt.compare(req.body.password, vendor.password); - if (match) { - // If the password matches, store a success message and relevant vendor data - res.locals.data = { - status: 'success', - message: 'Successful login.', - vendorDetails: { - id: vendor.id, - email: vendor.email, - // TODO: Include any other vendor details we need - } - }; - next(); - } else { - res.status(401).json({ message: "Incorrect email or password." }); - } - } catch (err) { - console.error(err); - res.status(500).json({ error: "Internal Server Error" }); + try { + const vendor = res.locals.data; + const match = await bcrypt.compare(req.body.password, vendor.password); + if (match) { + // If the password matches, store a success message and relevant vendor data + res.locals.data = { + status: 'success', + message: 'Successful login.', + vendorDetails: { + id: vendor.id, + email: vendor.email, + // TODO: Include any other vendor details we need + }, + }; + next(); + } else { + res.status(401).json({message: 'Incorrect email or password.'}); } + } catch (err) { + console.error(err); + res.status(500).json({error: 'Internal Server Error'}); + } }; const getVendors = async (req, res, next) => { - try { - // Retrieve all vendors from the database - const vendors = await db.manyOrNone('SELECT * FROM Vendors'); + try { + // Retrieve all vendors from the database + const vendors = await db.manyOrNone('SELECT * FROM Vendors'); - // If vendors are found, add them to res.locals.data - if (vendors.length) { - res.locals.data = vendors; - next(); // Proceed to the next middleware or route handler - } else { - // If no vendors are found, send a message indicating this - res.status(404).json({ message: "No vendors found" }); - } - } catch (error) { - console.error(error); - res.status(500).json({ error: "Internal Server Error" }); + // If vendors are found, add them to res.locals.data + if (vendors.length) { + res.locals.data = vendors; + next(); // Proceed to the next middleware or route handler + } else { + // If no vendors are found, send a message indicating this + res.status(404).json({message: 'No vendors found'}); } + } catch (error) { + console.error(error); + res.status(500).json({error: 'Internal Server Error'}); + } }; const getVendorById = async (req, res, next) => { - const { vendor_id } = req.params; + const {vendorId} = req.params; - try { - const vendor = await db.oneOrNone('SELECT * FROM Vendors WHERE vendor_id = $1', [vendor_id]); - if (vendor) { - // Store the vendor data in res.locals.data for the middleware - res.locals.data = vendor; - next(); // Pass control to the next middleware - } else { - res.status(404).json({ message: "Vendor not found" }); - } - } catch (err) { - console.error(err); - res.status(500).json({ error: "Internal Server Error" }); + try { + const vendor = await db.oneOrNone( + 'SELECT * FROM Vendors WHERE vendor_id = $1', + [vendorId], + ); + if (vendor) { + // Store the vendor data in res.locals.data for the middleware + res.locals.data = vendor; + next(); // Pass control to the next middleware + } else { + res.status(404).json({message: 'Vendor not found'}); } + } catch (err) { + console.error(err); + res.status(500).json({error: 'Internal Server Error'}); + } }; -//Registers the vendor in the database +// Registers the vendor in the database const createVendor = async (req, res, next) => { - //Get the values from the request body - const { - name, - email, - phone_number, - password, - website - } = req.body; + // Get the values from the request body + const { + name, + email, + phone_number, + password, + website, + } = req.body; - //Checks if the required fields are present - if (!password || !email || !name) { - console.log(req.body); - return res.status(400).json({ error: 'Missing required fields' }); - } + // Checks if the required fields are present + if (!password || !email || !name) { + console.log(req.body); + return res.status(400).json({error: 'Missing required fields'}); + } - //Hashes the password using bcrypt - let password_hash = undefined; - try { - const salt = await genSalt(10); - password_hash = await hash(password, salt); - } catch (err) { - console.log(err); - res.status(500).json({ error: err }); - return; - } + // Hashes the password using bcrypt + let passwordHash; + try { + const salt = await genSalt(10); + passwordHash = await hash(password, salt); + } catch (err) { + console.log(err); + res.status(500).json({error: err}); + return; + } - //Inserts the vendor into the database - try { - await db.none( - 'INSERT INTO Vendors (\ + // Inserts the vendor into the database + try { + await db.none( + 'INSERT INTO Vendors (\ name, \ email, \ phone_number, \ password, \ website\ ) VALUES ($1, $2, $3, $4, $5)', - [name, email, phone_number, password_hash, website] - ); - } catch (err) { - //Duplicate emails are not allowed - if (err.code === '23505') { - res.status(400).json({ error: 'A vendor with that email already exists' }); - return; - } - - //Other internal error - console.log(err); - res.status(500).json({ error: err }); - return; + [name, email, phone_number, passwordHash, website], + ); + } catch (err) { + // Duplicate emails are not allowed + if (err.code === '23505') { + res.status(400).json({error: 'A vendor with that email already exists'}); + return; } - next(); -}; + // Other internal error + console.log(err); + res.status(500).json({error: err}); + return; + } + next(); +}; -module.exports = { getVendor, getVendors, createVendor, getVendorById, authenticateVendor } \ No newline at end of file +module.exports = {getVendor, getVendors, createVendor, getVendorById, authenticateVendor}; diff --git a/backend/database.js b/backend/database.js index 4a818f5..9ca244f 100644 --- a/backend/database.js +++ b/backend/database.js @@ -1,18 +1,21 @@ -//Import the pg-promise library and initialize it +// Import the pg-promise library and initialize it const pgp = require('pg-promise')(); -//Connect to the database using the environment variable DATABASE_URL -if(process.env.DATABASE_URL === undefined) throw new Error("DATABASE_URL environment variable not set"); +// Connect to the database using the environment variable DATABASE_URL +if (process.env.DATABASE_URL === undefined) { + throw new Error('DATABASE_URL environment variable not set'); +} + const db = pgp(process.env.DATABASE_URL); /* -The database object above represents a connection to our database. However, +The database object above represents a connection to our database. However, it isn't actually connected yet. The object is an abstraction of the connection. When you run a query against db, it will automatically connect to the database and release it when its finished. This database object should be the only one in the application. We import -the file where we need to make queries. +the file where we need to make queries. */ -module.exports = db; \ No newline at end of file +module.exports = db; diff --git a/backend/index.js b/backend/index.js index d78d456..896c280 100644 --- a/backend/index.js +++ b/backend/index.js @@ -1,33 +1,37 @@ -// Load the environment variables from the .env file in the backend root folder -if(require('dotenv').config().parsed === undefined) - throw new Error("Could not load environment variables"); - +// Load the environment variables from the .env file in the backend root folder +if (require('dotenv').config().parsed === undefined) { + throw new Error('Could not load environment variables'); +} // Import the database object from the database.js file const db = require('./database'); -//Import Express and initialize our app -const express = require('express') +// Import Express and initialize our app +const express = require('express'); const app = express(); -const errorHandler = require('errorhandler') +const errorHandler = require('errorhandler'); app.use(errorHandler({dumbExceptions: true, showStack: true})); - -//Parse Json requests +// Parse Json requests app.use(express.json()); -//Import router objects and direct the app to use them +// Import router objects and direct the app to use them const VendorRouter = require('./routes/VendorRouter'); app.use('/vendors', VendorRouter); app.get('/', (req, res) => { - res.status(202).send('Hello World!') -}) + res.status(202).send('Hello World!'); +}); + +/* +The backend should be listening on port 3000 within its container, +but the container's port 3000 is mapped externally to 3001. + +TL;DR the backend is running on port 3001 on the host machine. +*/ -//The backend should be listening on port 3000 within its container, but the container's port 3000 is mapped externally to 3001. -// TL;DR the backend is running on port 3001 on the host machine. app.listen(process.env.BACKEND_PORT, () => { - console.log(`PIM backend app listening on port ${process.env.BACKEND_PORT}`) -}) \ No newline at end of file + console.log(`PIM backend app listening on port ${process.env.BACKEND_PORT}`); +}); diff --git a/backend/middleware/successResponse.js b/backend/middleware/successResponse.js index 298dfbe..4426179 100644 --- a/backend/middleware/successResponse.js +++ b/backend/middleware/successResponse.js @@ -1,11 +1,16 @@ // successResponse.js function sendSuccessResponse(req, res) { - if (res.locals.data) { - res.status(200).json(res.locals.data); - } else { - // Fallback if no data is set in res.locals, but middleware is called - res.status(200).json({ status: 'success', message: 'Operation completed successfully.' }); - } + if (res.locals.data) { + res.status(200).json(res.locals.data); + } else { + // Fallback if no data is set in res.locals, but middleware is called + res.status(200).json( + { + status: 'success', + message: 'Operation completed successfully.', + }, + ); + } } -module.exports = sendSuccessResponse; \ No newline at end of file +module.exports = sendSuccessResponse; diff --git a/backend/package-lock.json b/backend/package-lock.json index 5720200..84f6094 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -12,10 +12,17 @@ "bcryptjs": "^2.4.3", "dotenv": "^16.3.1", "errorhandler": "^1.5.1", - "eslint": "^8.53.0", + "eslint-config-google": "^0.14.0", "express": "^4.18.2", "nodemon": "^3.0.1", "pg-promise": "^11.5.4" + }, + "devDependencies": { + "eslint": "^8.53.0", + "eslint-config-standard": "^17.1.0", + "eslint-plugin-import": "^2.29.0", + "eslint-plugin-n": "^16.3.1", + "eslint-plugin-promise": "^6.1.1" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -182,6 +189,12 @@ "node": ">= 8" } }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", @@ -277,11 +290,119 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, + "node_modules/array-includes": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", + "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", + "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", + "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/assert-options": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/assert-options/-/assert-options-0.8.1.tgz", @@ -290,6 +411,18 @@ "node": ">=10.0.0" } }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -359,6 +492,27 @@ "node": ">=4" } }, + "node_modules/builtin-modules": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/builtins": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", + "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "dev": true, + "dependencies": { + "semver": "^7.0.0" + } + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -540,6 +694,23 @@ "node": ">= 0.4" } }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -604,6 +775,99 @@ "node": ">= 0.8" } }, + "node_modules/es-abstract": { + "version": "1.22.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.3.tgz", + "integrity": "sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.2", + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.5", + "es-set-tostringtag": "^2.0.1", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.2", + "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.12", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.1", + "safe-array-concat": "^1.0.1", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.2.tgz", + "integrity": "sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.2", + "has-tostringtag": "^1.0.0", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -674,6 +938,229 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-google": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/eslint-config-google/-/eslint-config-google-0.14.0.tgz", + "integrity": "sha512-WsbX4WbjuMvTdeVL6+J3rK1RGhCTqjsFjX7UMSMgZiyxxaNLkoJENbrGExzERFeoTpGw3F3FypTiWAP9ZXzkEw==", + "engines": { + "node": ">=0.10.0" + }, + "peerDependencies": { + "eslint": ">=5.16.0" + } + }, + "node_modules/eslint-config-standard": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.1.0.tgz", + "integrity": "sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "eslint": "^8.0.1", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-n": "^15.0.0 || ^16.0.0 ", + "eslint-plugin-promise": "^6.0.0" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/eslint-module-utils": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", + "dev": true, + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/eslint-plugin-es-x": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.3.0.tgz", + "integrity": "sha512-W9zIs+k00I/I13+Bdkl/zG1MEO07G97XjUSQuH117w620SJ6bHtLUmoMvkGA2oYnI/gNdr+G7BONLyYnFaLLEQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.1.2", + "@eslint-community/regexpp": "^4.6.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + }, + "peerDependencies": { + "eslint": ">=8" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.0.tgz", + "integrity": "sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.14.2" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-plugin-n": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.3.1.tgz", + "integrity": "sha512-w46eDIkxQ2FaTHcey7G40eD+FhTXOdKudDXPUO2n9WNcslze/i/HT2qJ3GXjHngYSGDISIgPNhwGtgoix4zeOw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "builtins": "^5.0.1", + "eslint-plugin-es-x": "^7.1.0", + "get-tsconfig": "^4.7.0", + "ignore": "^5.2.4", + "is-builtin-module": "^3.2.1", + "is-core-module": "^2.12.1", + "minimatch": "^3.1.2", + "resolve": "^1.22.2", + "semver": "^7.5.3" + }, + "engines": { + "node": ">=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-promise": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz", + "integrity": "sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, "node_modules/eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", @@ -930,6 +1417,15 @@ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==" }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -972,6 +1468,33 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-intrinsic": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", @@ -986,6 +1509,34 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-tsconfig": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.2.tgz", + "integrity": "sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -1030,6 +1581,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -1046,6 +1612,15 @@ "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==" }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -1087,6 +1662,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/hasown": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", @@ -1174,6 +1764,20 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "node_modules/internal-slot": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.6.tgz", + "integrity": "sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.2", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -1182,51 +1786,265 @@ "node": ">= 0.10" } }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "node_modules/is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-builtin-module": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", + "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", + "dev": true, + "dependencies": { + "builtin-modules": "^3.3.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, "dependencies": { - "binary-extensions": "^2.0.0" + "has-tostringtag": "^1.0.0" }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/is-typed-array": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "dev": true, "dependencies": { - "is-extglob": "^2.1.1" + "which-typed-array": "^1.1.11" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "engines": { - "node": ">=0.12.0" + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "engines": { - "node": ">=8" - } + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true }, "node_modules/isexe": { "version": "2.0.0", @@ -1259,6 +2077,18 @@ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" }, + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -1371,6 +2201,15 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -1459,6 +2298,79 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", + "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", + "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1" + } + }, + "node_modules/object.values": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", + "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -1570,6 +2482,12 @@ "node": ">=8" } }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, "node_modules/path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -1825,6 +2743,40 @@ "node": ">=8.10.0" } }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", + "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "set-function-name": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -1833,6 +2785,15 @@ "node": ">=4" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -1878,6 +2839,24 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/safe-array-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", + "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1897,6 +2876,20 @@ } ] }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -1972,6 +2965,20 @@ "node": ">= 0.4" } }, + "node_modules/set-function-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", + "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -2044,6 +3051,51 @@ "node": ">= 0.8" } }, + "node_modules/string.prototype.trim": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", + "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", + "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -2055,6 +3107,15 @@ "node": ">=8" } }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -2077,6 +3138,18 @@ "node": ">=4" } }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -2112,6 +3185,18 @@ "nodetouch": "bin/nodetouch.js" } }, + "node_modules/tsconfig-paths": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", + "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", + "dev": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -2146,6 +3231,86 @@ "node": ">= 0.6" } }, + "node_modules/typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/undefsafe": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", @@ -2197,6 +3362,41 @@ "node": ">= 8" } }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", + "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.4", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/backend/package.json b/backend/package.json index c743fea..11dc975 100644 --- a/backend/package.json +++ b/backend/package.json @@ -4,6 +4,8 @@ "description": "", "main": "index.js", "scripts": { + "lint": "eslint . --ext .js", + "lint-fix": "eslint --fix . --ext .js", "predev": "npm i", "dev": "nodemon index.js", "test": "echo \"Error: no test specified\" && exit 1" @@ -14,9 +16,16 @@ "bcryptjs": "^2.4.3", "dotenv": "^16.3.1", "errorhandler": "^1.5.1", - "eslint": "^8.53.0", + "eslint-config-google": "^0.14.0", "express": "^4.18.2", "nodemon": "^3.0.1", "pg-promise": "^11.5.4" + }, + "devDependencies": { + "eslint": "^8.53.0", + "eslint-config-standard": "^17.1.0", + "eslint-plugin-import": "^2.29.0", + "eslint-plugin-n": "^16.3.1", + "eslint-plugin-promise": "^6.1.1" } } diff --git a/backend/routes/VendorRouter.js b/backend/routes/VendorRouter.js index 908c96e..c694f42 100644 --- a/backend/routes/VendorRouter.js +++ b/backend/routes/VendorRouter.js @@ -1,9 +1,14 @@ const express = require('express'); const router = express.Router(); -const { getVendor, getVendors, createVendor, getVendorById, authenticateVendor } = require('../controllers/VendorController'); +const { + getVendor, + getVendors, + createVendor, + getVendorById, + authenticateVendor, +} = require('../controllers/VendorController'); const sendSuccessResponse = require('../middleware/successResponse'); - // Logs in vendor router.post('/login', getVendor, authenticateVendor, sendSuccessResponse); @@ -11,11 +16,11 @@ router.post('/login', getVendor, authenticateVendor, sendSuccessResponse); router.get('/', getVendors, sendSuccessResponse); // Fetches a single vendor by ID -router.get('/:vendor_id', getVendorById, sendSuccessResponse); +router.get('/:vendorId', getVendorById, sendSuccessResponse); // Creates a new vendor router.post('/', createVendor, (req, res) => { - res.status(200).json({ status: 'success' }); + res.status(200).json({status: 'success'}); }); -module.exports = router; \ No newline at end of file +module.exports = router; From 7b95751fd5ad04411b5143e9a980a5f1924ed679 Mon Sep 17 00:00:00 2001 From: nh602 Date: Mon, 13 Nov 2023 21:13:26 +0000 Subject: [PATCH 2/3] setup eslint on frontend --- frontend/.eslintrc.js | 33 ++++++ frontend/package-lock.json | 37 ++++-- frontend/package.json | 5 + frontend/src/config.js | 6 +- frontend/src/index.js | 77 ++++++------ frontend/src/objects/Vendor.js | 44 +++---- frontend/src/reportWebVitals.js | 4 +- .../services/MockServices/MockLoginService.js | 38 +++--- .../MockServices/MockVendorService.js | 112 +++++++++--------- frontend/src/setupTests.js | 8 +- frontend/tailwind.config.js | 4 +- 11 files changed, 211 insertions(+), 157 deletions(-) create mode 100644 frontend/.eslintrc.js diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js new file mode 100644 index 0000000..6264015 --- /dev/null +++ b/frontend/.eslintrc.js @@ -0,0 +1,33 @@ +module.exports = { + 'env': { + 'browser': true, + 'es2021': true, + }, + 'extends': [ + 'google', + 'plugin:react/recommended', + ], + 'overrides': [ + { + 'env': { + 'node': true, + }, + 'files': [ + '.eslintrc.{js,cjs}', + ], + 'parserOptions': { + 'sourceType': 'script', + }, + }, + ], + 'parserOptions': { + 'ecmaVersion': 'latest', + 'sourceType': 'module', + }, + 'plugins': [ + 'react', + ], + 'rules': { + 'require-jsdoc': 0, + }, +}; diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 314cd8f..da95cfb 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -26,6 +26,9 @@ "web-vitals": "^2.1.4" }, "devDependencies": { + "eslint": "^8.53.0", + "eslint-config-google": "^0.14.0", + "eslint-plugin-react": "^7.33.2", "tailwindcss": "^3.3.5" } }, @@ -2305,9 +2308,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", - "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.3.tgz", + "integrity": "sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -2368,9 +2371,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.52.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.52.0.tgz", - "integrity": "sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.53.0.tgz", + "integrity": "sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } @@ -7421,14 +7424,14 @@ } }, "node_modules/eslint": { - "version": "8.52.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.52.0.tgz", - "integrity": "sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.53.0.tgz", + "integrity": "sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.52.0", + "@eslint/eslintrc": "^2.1.3", + "@eslint/js": "8.53.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -7474,6 +7477,18 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-google": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/eslint-config-google/-/eslint-config-google-0.14.0.tgz", + "integrity": "sha512-WsbX4WbjuMvTdeVL6+J3rK1RGhCTqjsFjX7UMSMgZiyxxaNLkoJENbrGExzERFeoTpGw3F3FypTiWAP9ZXzkEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + }, + "peerDependencies": { + "eslint": ">=5.16.0" + } + }, "node_modules/eslint-config-react-app": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/eslint-config-react-app/-/eslint-config-react-app-7.0.1.tgz", diff --git a/frontend/package.json b/frontend/package.json index 01aba92..62d37ed 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -21,6 +21,8 @@ "web-vitals": "^2.1.4" }, "scripts": { + "lint": "eslint . --ext .js", + "lint-fix": "eslint --fix . --ext .js", "prestart": "npm i", "start": "react-scripts start", "build": "react-scripts build", @@ -46,6 +48,9 @@ ] }, "devDependencies": { + "eslint": "^8.53.0", + "eslint-config-google": "^0.14.0", + "eslint-plugin-react": "^7.33.2", "tailwindcss": "^3.3.5" } } diff --git a/frontend/src/config.js b/frontend/src/config.js index ab892a5..3538cb2 100644 --- a/frontend/src/config.js +++ b/frontend/src/config.js @@ -1,5 +1,5 @@ -const config = { - environment: 'dev', +const config = { + environment: 'dev', }; -export default config; \ No newline at end of file +export default config; diff --git a/frontend/src/index.js b/frontend/src/index.js index 4ecc9dd..f7a3aa3 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -7,8 +7,8 @@ import Root from './routes/root'; import ReactDOM from 'react-dom/client'; import reportWebVitals from './reportWebVitals'; import ServiceExample from './routes/serviceexample'; -import "./App.css"; -import {createBrowserRouter, RouterProvider } from 'react-router-dom'; +import './App.css'; +import {createBrowserRouter, RouterProvider} from 'react-router-dom'; // import axios from 'axios'; import Register from './routes/register'; import ResetPassword from './routes/reset_password'; @@ -16,7 +16,7 @@ import MockVendorService from './services/MockServices/MockVendorService.js'; import config from './config.js'; -let isadmin = true +const isadmin = true; // if(!session){ // path = '/login' @@ -30,51 +30,52 @@ let isadmin = true // } // Setup the mock vendor service -if(config.environment === "dev") +if (config.environment === 'dev') { MockVendorService.init(); +} const router = createBrowserRouter([ { - path: "/", + path: '/', // loader: loaderfunc(), element: , - children:[ - { - path: "/vendor", - element: - }, - { - path: '/login', - element: - }, - { - path: '/register', - element: - }, - { - path: '/reset_password', - element: - }, - { - path: '/profile', - element: - }, - { - path: '/events', - element: - }, - config.environment === "dev" && { - path: '/service-example', - element: - }] + children: [ + { + path: '/vendor', + element: , + }, + { + path: '/login', + element: , + }, + { + path: '/register', + element: , + }, + { + path: '/reset_password', + element: , + }, + { + path: '/profile', + element: , + }, + { + path: '/events', + element: , + }, + config.environment === 'dev' && { + path: '/service-example', + element: , + }], }, -]) +]); const root = ReactDOM.createRoot(document.getElementById('root')); export default Root = root.render( - - - + + + , ); // If you want to start measuring performance in your app, pass a function diff --git a/frontend/src/objects/Vendor.js b/frontend/src/objects/Vendor.js index c57d5e6..21c11a1 100644 --- a/frontend/src/objects/Vendor.js +++ b/frontend/src/objects/Vendor.js @@ -1,35 +1,35 @@ /* Storage mechanism for a vendor object */ -class Vendor{ - /* +class Vendor { + /* id: int - database id assigned to this vendor name: string - name of the vendor email: string - email of the vendor website: string - (Optional) website of the vendor. phone_number: string - (Optional) phone number of the vendor. */ - constructor(id, name, email, website = undefined, phone_number = undefined){ - this.id = id; - this.name = name; - this.email = email; - this.website = website; - this.phone_number = phone_number; - } + constructor(id, name, email, website = undefined, phone_number = undefined) { + this.id = id; + this.name = name; + this.email = email; + this.website = website; + this.phone_number = phone_number; + } - //Create a vendor object from json representation - // constructor(json){ - // this.id = json.vendor_id; - // this.name = json.name; - // this.email = json.email; - // this.website = json.website; - // this.phone_number = json.phone_number; - // } + // Create a vendor object from json representation + // constructor(json){ + // this.id = json.vendor_id; + // this.name = json.name; + // this.email = json.email; + // this.website = json.website; + // this.phone_number = json.phone_number; + // } - //Use this method to get a json object for the vendor - get json(){ - return JSON.stringify(this); - } + // Use this method to get a json object for the vendor + get json() { + return JSON.stringify(this); + } } -module.exports = Vendor; \ No newline at end of file +module.exports = Vendor; diff --git a/frontend/src/reportWebVitals.js b/frontend/src/reportWebVitals.js index 5253d3a..a8cc5b3 100644 --- a/frontend/src/reportWebVitals.js +++ b/frontend/src/reportWebVitals.js @@ -1,6 +1,6 @@ -const reportWebVitals = onPerfEntry => { +const reportWebVitals = (onPerfEntry) => { if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { + import('web-vitals').then(({getCLS, getFID, getFCP, getLCP, getTTFB}) => { getCLS(onPerfEntry); getFID(onPerfEntry); getFCP(onPerfEntry); diff --git a/frontend/src/services/MockServices/MockLoginService.js b/frontend/src/services/MockServices/MockLoginService.js index 6f671a6..cf00008 100644 --- a/frontend/src/services/MockServices/MockLoginService.js +++ b/frontend/src/services/MockServices/MockLoginService.js @@ -5,28 +5,28 @@ import MockVendorService from './MockVendorService.js'; Provides an interface to login / register with the backend. */ export default class MockLoginService { - //Attempts to login the user. Returns a Vendor object on success, or null on failure - static login({email, password}) { - //Get the vendor with the given email - const v = MockVendorService.getVendorByEmail(email); + // Attempts to login the user. Returns a Vendor object on success, or null on failure + static login({email, password}) { + // Get the vendor with the given email + const v = MockVendorService.getVendorByEmail(email); - //Check if the vendor exists and the password is correct - if(v != null) return v; + // Check if the vendor exists and the password is correct + if (v != null) return v; - return null; - } + return null; + } - //Attempts to register the user. Returns true on success, and false on failure. - static register({name, email, password, website, phone_number}) { - //Check if email is already in use - if(MockVendorService.getVendorByEmail(email) != null) return false; + // Attempts to register the user. Returns true on success, and false on failure. + static register({name, email, password, website, phone_number}) { + // Check if email is already in use + if (MockVendorService.getVendorByEmail(email) != null) return false; - //Create the vendor - const v = new Vendor(MockVendorService.getLastVendorId() + 1, name, email, website, phone_number); + // Create the vendor + const v = new Vendor(MockVendorService.getLastVendorId() + 1, name, email, website, phone_number); - //Add the vendor to the database - MockVendorService.createVendor(v); + // Add the vendor to the database + MockVendorService.createVendor(v); - return true; - } -} \ No newline at end of file + return true; + } +} diff --git a/frontend/src/services/MockServices/MockVendorService.js b/frontend/src/services/MockServices/MockVendorService.js index db5edbc..881dee0 100644 --- a/frontend/src/services/MockServices/MockVendorService.js +++ b/frontend/src/services/MockServices/MockVendorService.js @@ -4,60 +4,60 @@ import Vendor from '../../objects/Vendor.js'; Provides an interface to retrieve vendor data from the backend. */ export default class MockVendorService { - //This is static so that every instance of MockVendorService has the same vendors - static mockvendors = []; - - //Creates many mock vendors. Generated with chatgpt! - static init(){ - if(this.mockvendors === undefined) this.mockvendors = []; - - if(this.mockvendors.length === 0){ - this.mockvendors.push(new Vendor(1, "John Smith", "John.smith@gmail.com", "www.johnsmith.com", "123-456-7890")); - this.mockvendors.push(new Vendor(2, "Jane Doe", "Jane.doe@gmail.com", "www.janedoe.com", "987-654-3210")); - this.mockvendors.push(new Vendor(3, "Michael Johnson", "Michael.johnson@gmail.com", "www.michaeljohnson.com", "555-123-7890")); - this.mockvendors.push(new Vendor(4, "Emily Wilson", "Emily.wilson@gmail.com", "www.emilywilson.com", "777-999-8888")); - this.mockvendors.push(new Vendor(5, "David Brown", "David.brown@gmail.com", "www.davidbrown.com", "111-222-3333")); - this.mockvendors.push(new Vendor(6, "Sophia Taylor", "Sophia.taylor@gmail.com", "www.sophiataylor.com", "444-777-2222")); - this.mockvendors.push(new Vendor(7, "James Miller", "James.miller@gmail.com", "www.jamesmiller.com", "888-777-9999")); - this.mockvendors.push(new Vendor(8, "Olivia Davis", "Olivia.davis@gmail.com", "www.oliviadavis.com", "666-333-1111")); - this.mockvendors.push(new Vendor(9, "Liam Anderson", "Liam.anderson@gmail.com", "www.liamanderson.com", "555-111-7777")); - this.mockvendors.push(new Vendor(10, "Ava White", "Ava.white@gmail.com", "www.avawhite.com", "222-444-6666")); - this.mockvendors.push(new Vendor(11, "William Moore", "William.moore@gmail.com", "www.williammoore.com", "444-111-5555")); - this.mockvendors.push(new Vendor(12, "Isabella Hall", "Isabella.hall@gmail.com", "www.isabellahall.com", "999-555-4444")); - this.mockvendors.push(new Vendor(13, "Benjamin Lewis", "Benjamin.lewis@gmail.com", "www.benjaminlewis.com", "111-333-6666")); - this.mockvendors.push(new Vendor(14, "Mia Martinez", "Mia.martinez@gmail.com", "www.miamartinez.com", "777-222-3333")); - this.mockvendors.push(new Vendor(15, "Ethan Clark", "Ethan.clark@gmail.com", "www.ethanclark.com", "333-666-9999")); - this.mockvendors.push(new Vendor(16, "Charlotte Walker", "Charlotte.walker@gmail.com", "www.charlottewalker.com", "555-999-1111")); - this.mockvendors.push(new Vendor(17, "Daniel Green", "Daniel.green@gmail.com", "www.danielgreen.com", "666-444-3333")); - this.mockvendors.push(new Vendor(18, "Amelia Baker", "Amelia.baker@gmail.com", "www.ameiliabaker.com", "888-999-7777")); - this.mockvendors.push(new Vendor(19, "Matthew King", "Matthew.king@gmail.com", "www.matthewking.com", "222-333-4444")); - this.mockvendors.push(new Vendor(20, "Grace Harris", "Grace.harris@gmail.com", "www.graceharris.com", "111-888-6666")); - } + // This is static so that every instance of MockVendorService has the same vendors + static mockvendors = []; + + // Creates many mock vendors. Generated with chatgpt! + static init() { + if (this.mockvendors === undefined) this.mockvendors = []; + + if (this.mockvendors.length === 0) { + this.mockvendors.push(new Vendor(1, 'John Smith', 'John.smith@gmail.com', 'www.johnsmith.com', '123-456-7890')); + this.mockvendors.push(new Vendor(2, 'Jane Doe', 'Jane.doe@gmail.com', 'www.janedoe.com', '987-654-3210')); + this.mockvendors.push(new Vendor(3, 'Michael Johnson', 'Michael.johnson@gmail.com', 'www.michaeljohnson.com', '555-123-7890')); + this.mockvendors.push(new Vendor(4, 'Emily Wilson', 'Emily.wilson@gmail.com', 'www.emilywilson.com', '777-999-8888')); + this.mockvendors.push(new Vendor(5, 'David Brown', 'David.brown@gmail.com', 'www.davidbrown.com', '111-222-3333')); + this.mockvendors.push(new Vendor(6, 'Sophia Taylor', 'Sophia.taylor@gmail.com', 'www.sophiataylor.com', '444-777-2222')); + this.mockvendors.push(new Vendor(7, 'James Miller', 'James.miller@gmail.com', 'www.jamesmiller.com', '888-777-9999')); + this.mockvendors.push(new Vendor(8, 'Olivia Davis', 'Olivia.davis@gmail.com', 'www.oliviadavis.com', '666-333-1111')); + this.mockvendors.push(new Vendor(9, 'Liam Anderson', 'Liam.anderson@gmail.com', 'www.liamanderson.com', '555-111-7777')); + this.mockvendors.push(new Vendor(10, 'Ava White', 'Ava.white@gmail.com', 'www.avawhite.com', '222-444-6666')); + this.mockvendors.push(new Vendor(11, 'William Moore', 'William.moore@gmail.com', 'www.williammoore.com', '444-111-5555')); + this.mockvendors.push(new Vendor(12, 'Isabella Hall', 'Isabella.hall@gmail.com', 'www.isabellahall.com', '999-555-4444')); + this.mockvendors.push(new Vendor(13, 'Benjamin Lewis', 'Benjamin.lewis@gmail.com', 'www.benjaminlewis.com', '111-333-6666')); + this.mockvendors.push(new Vendor(14, 'Mia Martinez', 'Mia.martinez@gmail.com', 'www.miamartinez.com', '777-222-3333')); + this.mockvendors.push(new Vendor(15, 'Ethan Clark', 'Ethan.clark@gmail.com', 'www.ethanclark.com', '333-666-9999')); + this.mockvendors.push(new Vendor(16, 'Charlotte Walker', 'Charlotte.walker@gmail.com', 'www.charlottewalker.com', '555-999-1111')); + this.mockvendors.push(new Vendor(17, 'Daniel Green', 'Daniel.green@gmail.com', 'www.danielgreen.com', '666-444-3333')); + this.mockvendors.push(new Vendor(18, 'Amelia Baker', 'Amelia.baker@gmail.com', 'www.ameiliabaker.com', '888-999-7777')); + this.mockvendors.push(new Vendor(19, 'Matthew King', 'Matthew.king@gmail.com', 'www.matthewking.com', '222-333-4444')); + this.mockvendors.push(new Vendor(20, 'Grace Harris', 'Grace.harris@gmail.com', 'www.graceharris.com', '111-888-6666')); } - - //Fetches all vendors from the backend - static getVendors(){ - return this.mockvendors; - } - - //Fetches the vendor with the given id from the backend - static getVendorbyId(id){ - const v = this.mockvendors.filter(vendor => vendor.id === id); - return v.length > 0 ? v[0] : null; - } - - //Fetches the vendor with the given email from the backend - static getVendorbyEmail(email){ - const v = this.mockvendors.filter(vendor => vendor.email === email); - return v.length > 0 ? v[0] : null; - } - - static getLastVendorId(){ - return this.mockvendors.length; - } - - //Sends backend request to create a vendor from the local vendor object - static createVendor(vendor){ - this.mockvendors.push(vendor); - } -} \ No newline at end of file + } + + // Fetches all vendors from the backend + static getVendors() { + return this.mockvendors; + } + + // Fetches the vendor with the given id from the backend + static getVendorbyId(id) { + const v = this.mockvendors.filter((vendor) => vendor.id === id); + return v.length > 0 ? v[0] : null; + } + + // Fetches the vendor with the given email from the backend + static getVendorbyEmail(email) { + const v = this.mockvendors.filter((vendor) => vendor.email === email); + return v.length > 0 ? v[0] : null; + } + + static getLastVendorId() { + return this.mockvendors.length; + } + + // Sends backend request to create a vendor from the local vendor object + static createVendor(vendor) { + this.mockvendors.push(vendor); + } +} diff --git a/frontend/src/setupTests.js b/frontend/src/setupTests.js index b6248f9..e33df4d 100644 --- a/frontend/src/setupTests.js +++ b/frontend/src/setupTests.js @@ -5,11 +5,11 @@ import '@testing-library/jest-dom'; import React from 'react'; // so that we can use JSX syntax import { - render, - cleanup, - waitForElement + render, + cleanup, + waitForElement, } from '@testing-library/react'; // testing helpers -import userEvent from '@testing-library/user-event' // testing helpers for imitating user events +import userEvent from '@testing-library/user-event'; // testing helpers for imitating user events import 'jest-dom/extend-expect'; // to extend Jest's expect with DOM assertions import './helpers/initTestLocalization'; // to configure i18n for tests diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js index c0958ec..0eb0dca 100644 --- a/frontend/tailwind.config.js +++ b/frontend/tailwind.config.js @@ -1,11 +1,11 @@ /** @type {import('tailwindcss').Config} */ module.exports = { content: [ - "./src/**/*.{js,jsx,ts,tsx}", + './src/**/*.{js,jsx,ts,tsx}', ], theme: { extend: {}, }, plugins: [], -} +}; From 47d91ab29c4200c76de965fc29e70bcce3595c47 Mon Sep 17 00:00:00 2001 From: nh602 Date: Mon, 13 Nov 2023 21:14:00 +0000 Subject: [PATCH 3/3] added setting to backend eslint --- backend/.eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/.eslintrc.js b/backend/.eslintrc.js index d4bbcce..a2ee21e 100644 --- a/backend/.eslintrc.js +++ b/backend/.eslintrc.js @@ -22,5 +22,6 @@ module.exports = { ecmaVersion: 'latest', }, rules: { + 'require-jsdoc': 0, }, };