From f24070ea7969e3d617c7740bf181992696a05675 Mon Sep 17 00:00:00 2001 From: Rene Pot Date: Mon, 31 Jul 2023 08:36:54 +0100 Subject: [PATCH 1/4] feat: use faster profanity checker --- .../text-moderation/functions/index.js | 77 ++++++++----------- .../text-moderation/functions/package.json | 4 +- .../callable-functions/functions/package.json | 4 +- .../callable-functions/functions/sanitizer.js | 41 ++++------ 4 files changed, 53 insertions(+), 73 deletions(-) diff --git a/Node-1st-gen/text-moderation/functions/index.js b/Node-1st-gen/text-moderation/functions/index.js index a8d64c9e3f..d4aafedf0e 100644 --- a/Node-1st-gen/text-moderation/functions/index.js +++ b/Node-1st-gen/text-moderation/functions/index.js @@ -13,73 +13,64 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -'use strict'; +"use strict"; -const functions = require('firebase-functions/v1'); -const capitalizeSentence = require('capitalize-sentence'); -const Filter = require('bad-words'); -const badWordsFilter = new Filter(); +const functions = require("firebase-functions/v1"); +const capitalizeSentence = require("capitalize-sentence"); +const { isProfane, replaceProfanities } = import("no-profanity"); // Moderates messages by lowering all uppercase messages and removing swearwords. -exports.moderator = functions.database.ref('/messages/{messageId}').onWrite((change) => { - const message = change.after.val(); +exports.moderator = functions.database.ref("/messages/{messageId}").onWrite((change) => { + const message = change.after.val(); - if (message && !message.sanitized) { - // Retrieved the message values. - functions.logger.log('Retrieved message content: ', message); + if (message && !message.sanitized) { + // Retrieved the message values. + functions.logger.log("Retrieved message content: ", message); - // Run moderation checks on on the message and moderate if needed. - const moderatedMessage = moderateMessage(message.text); + // Run moderation checks on on the message and moderate if needed. + const moderatedMessage = moderateMessage(message.text); - // Update the Firebase DB with checked message. - functions.logger.log( - 'Message has been moderated. Saving to DB: ', - moderatedMessage - ); - return change.after.ref.update({ - text: moderatedMessage, - sanitized: true, - moderated: message.text !== moderatedMessage, - }); - } - return null; + // Update the Firebase DB with checked message. + functions.logger.log("Message has been moderated. Saving to DB: ", moderatedMessage); + return change.after.ref.update({ + text: moderatedMessage, + sanitized: true, + moderated: message.text !== moderatedMessage, + }); + } + return null; }); // Moderates the given message if appropriate. function moderateMessage(message) { - // Re-capitalize if the user is Shouting. - if (isShouting(message)) { - functions.logger.log('User is shouting. Fixing sentence case...'); - message = stopShouting(message); - } + // Re-capitalize if the user is Shouting. + if (isShouting(message)) { + functions.logger.log("User is shouting. Fixing sentence case..."); + message = stopShouting(message); + } - // Moderate if the user uses SwearWords. - if (containsSwearwords(message)) { - functions.logger.log('User is swearing. moderating...'); - message = moderateSwearwords(message); - } + // Moderate if the user uses SwearWords. + if (isProfane(message)) { + functions.logger.log("User is swearing. moderating..."); + message = moderateSwearwords(message); + } - return message; -} - -// Returns true if the string contains swearwords. -function containsSwearwords(message) { - return message !== badWordsFilter.clean(message); + return message; } // Hide all swearwords. e.g: Crap => ****. function moderateSwearwords(message) { - return badWordsFilter.clean(message); + return replaceProfanities(message); } // Detect if the current message is shouting. i.e. there are too many Uppercase // characters or exclamation points. function isShouting(message) { - return message.replace(/[^A-Z]/g, '').length > message.length / 2 || message.replace(/[^!]/g, '').length >= 3; + return message.replace(/[^A-Z]/g, "").length > message.length / 2 || message.replace(/[^!]/g, "").length >= 3; } // Correctly capitalize the string as a sentence (e.g. uppercase after dots) // and remove exclamation points. function stopShouting(message) { - return capitalizeSentence(message.toLowerCase()).replace(/!+/g, '.'); + return capitalizeSentence(message.toLowerCase()).replace(/!+/g, "."); } diff --git a/Node-1st-gen/text-moderation/functions/package.json b/Node-1st-gen/text-moderation/functions/package.json index 49933342ad..c247d67264 100644 --- a/Node-1st-gen/text-moderation/functions/package.json +++ b/Node-1st-gen/text-moderation/functions/package.json @@ -2,10 +2,10 @@ "name": "text-moderation-functions", "description": "Moderate text using Firebase Functions", "dependencies": { - "bad-words": "^3.0.4", "capitalize-sentence": "^0.1.5", "firebase-admin": "^11.9.0", - "firebase-functions": "^4.4.1" + "firebase-functions": "^4.4.1", + "no-profanity": "^1.1.5" }, "devDependencies": { "eslint": "^8.40.0" diff --git a/Node/quickstarts/callable-functions/functions/package.json b/Node/quickstarts/callable-functions/functions/package.json index aa4663b72f..6da017187f 100644 --- a/Node/quickstarts/callable-functions/functions/package.json +++ b/Node/quickstarts/callable-functions/functions/package.json @@ -16,10 +16,10 @@ }, "main": "index.js", "dependencies": { - "bad-words": "^3.0.4", "capitalize-sentence": "^0.1.5", "firebase-admin": "^11.9.0", - "firebase-functions": "^4.4.1" + "firebase-functions": "^4.4.1", + "no-profanity": "^1.1.5" }, "devDependencies": { "eslint": "^8.40.0", diff --git a/Node/quickstarts/callable-functions/functions/sanitizer.js b/Node/quickstarts/callable-functions/functions/sanitizer.js index 73cf55fd2e..3be7f3a2be 100644 --- a/Node/quickstarts/callable-functions/functions/sanitizer.js +++ b/Node/quickstarts/callable-functions/functions/sanitizer.js @@ -16,42 +16,32 @@ "use strict"; const capitalizeSentence = require("capitalize-sentence"); -const Filter = require("bad-words"); -const badWordsFilter = new Filter(); +const { isProfane, replaceProfanities } = import("no-profanity"); // Sanitizes the given text if needed by replacing bad words with '*'. exports.sanitizeText = (text) => { - // Re-capitalize if the user is Shouting. - if (isShouting(text)) { - console.log("User is shouting. Fixing sentence case..."); - text = stopShouting(text); - } + // Re-capitalize if the user is Shouting. + if (isShouting(text)) { + console.log("User is shouting. Fixing sentence case..."); + text = stopShouting(text); + } - // Moderate if the user uses SwearWords. - if (containsSwearwords(text)) { - console.log("User is swearing. moderating..."); - text = replaceSwearwords(text); - } + // Moderate if the user uses SwearWords. + if (isProfane(text)) { + console.log("User is swearing. moderating..."); + text = replaceSwearwords(text); + } - return text; + return text; }; -/** - * Returns true if the string contains swearwords. - * @param {string} message - * @return {boolean} - */ -function containsSwearwords(message) { - return message !== badWordsFilter.clean(message); -} - /** * Hide all swearwords. e.g: Crap => ****. * @param {string} message * @return {string} */ function replaceSwearwords(message) { - return badWordsFilter.clean(message); + return replaceProfanities(message); } /** @@ -61,8 +51,7 @@ function replaceSwearwords(message) { * @return {boolean} */ function isShouting(message) { - return message.replace(/[^A-Z]/g, "").length > message.length / 2 || - message.replace(/[^!]/g, "").length >= 3; + return message.replace(/[^A-Z]/g, "").length > message.length / 2 || message.replace(/[^!]/g, "").length >= 3; } /** @@ -72,5 +61,5 @@ function isShouting(message) { * @return {string} capitalized string */ function stopShouting(message) { - return capitalizeSentence(message.toLowerCase()).replace(/!+/g, "."); + return capitalizeSentence(message.toLowerCase()).replace(/!+/g, "."); } From 16beef24e0f74678ac73a6be4dd2847f5a413b35 Mon Sep 17 00:00:00 2001 From: Rene Pot Date: Mon, 31 Jul 2023 14:33:45 +0100 Subject: [PATCH 2/4] chore: fix version --- .../text-moderation/functions/package.json | 48 ++++++++-------- .../callable-functions/functions/package.json | 56 +++++++++---------- .../callable-functions/functions/sanitizer.js | 30 +++++----- 3 files changed, 67 insertions(+), 67 deletions(-) diff --git a/Node-1st-gen/text-moderation/functions/package.json b/Node-1st-gen/text-moderation/functions/package.json index c247d67264..0851c1068b 100644 --- a/Node-1st-gen/text-moderation/functions/package.json +++ b/Node-1st-gen/text-moderation/functions/package.json @@ -1,26 +1,26 @@ { - "name": "text-moderation-functions", - "description": "Moderate text using Firebase Functions", - "dependencies": { - "capitalize-sentence": "^0.1.5", - "firebase-admin": "^11.9.0", - "firebase-functions": "^4.4.1", - "no-profanity": "^1.1.5" - }, - "devDependencies": { - "eslint": "^8.40.0" - }, - "scripts": { - "lint": "./node_modules/.bin/eslint --max-warnings=0 .", - "serve": "firebase emulators:start --only functions", - "shell": "firebase functions:shell", - "start": "npm run shell", - "deploy": "firebase deploy --only functions", - "logs": "firebase functions:log", - "compile": "cp ../../../tsconfig.template.json ./tsconfig-compile.json && tsc --project tsconfig-compile.json" - }, - "engines": { - "node": "18" - }, - "private": true + "name": "text-moderation-functions", + "description": "Moderate text using Firebase Functions", + "dependencies": { + "capitalize-sentence": "^0.1.5", + "firebase-admin": "^11.9.0", + "firebase-functions": "^4.4.1", + "no-profanity": "^1.1.6" + }, + "devDependencies": { + "eslint": "^8.40.0" + }, + "scripts": { + "lint": "./node_modules/.bin/eslint --max-warnings=0 .", + "serve": "firebase emulators:start --only functions", + "shell": "firebase functions:shell", + "start": "npm run shell", + "deploy": "firebase deploy --only functions", + "logs": "firebase functions:log", + "compile": "cp ../../../tsconfig.template.json ./tsconfig-compile.json && tsc --project tsconfig-compile.json" + }, + "engines": { + "node": "18" + }, + "private": true } diff --git a/Node/quickstarts/callable-functions/functions/package.json b/Node/quickstarts/callable-functions/functions/package.json index 6da017187f..9c7bec0d18 100644 --- a/Node/quickstarts/callable-functions/functions/package.json +++ b/Node/quickstarts/callable-functions/functions/package.json @@ -1,30 +1,30 @@ { - "name": "functions", - "description": "Cloud Functions for Firebase", - "scripts": { - "lint": "eslint .", - "lintfix": "eslint . --fix", - "serve": "firebase emulators:start --only functions", - "shell": "firebase functions:shell", - "start": "npm run shell", - "deploy": "firebase deploy --only functions", - "logs": "firebase functions:log", - "compile": "cp ../../../../tsconfig.template.json ./tsconfig-compile.json && tsc --project tsconfig-compile.json" - }, - "engines": { - "node": "18" - }, - "main": "index.js", - "dependencies": { - "capitalize-sentence": "^0.1.5", - "firebase-admin": "^11.9.0", - "firebase-functions": "^4.4.1", - "no-profanity": "^1.1.5" - }, - "devDependencies": { - "eslint": "^8.40.0", - "eslint-config-google": "^0.14.0", - "firebase-functions-test": "^3.1.0" - }, - "private": true + "name": "functions", + "description": "Cloud Functions for Firebase", + "scripts": { + "lint": "eslint .", + "lintfix": "eslint . --fix", + "serve": "firebase emulators:start --only functions", + "shell": "firebase functions:shell", + "start": "npm run shell", + "deploy": "firebase deploy --only functions", + "logs": "firebase functions:log", + "compile": "cp ../../../../tsconfig.template.json ./tsconfig-compile.json && tsc --project tsconfig-compile.json" + }, + "engines": { + "node": "18" + }, + "main": "index.js", + "dependencies": { + "capitalize-sentence": "^0.1.5", + "firebase-admin": "^11.9.0", + "firebase-functions": "^4.4.1", + "no-profanity": "^1.1.6" + }, + "devDependencies": { + "eslint": "^8.40.0", + "eslint-config-google": "^0.14.0", + "firebase-functions-test": "^3.1.0" + }, + "private": true } diff --git a/Node/quickstarts/callable-functions/functions/sanitizer.js b/Node/quickstarts/callable-functions/functions/sanitizer.js index 3be7f3a2be..f7976b8b12 100644 --- a/Node/quickstarts/callable-functions/functions/sanitizer.js +++ b/Node/quickstarts/callable-functions/functions/sanitizer.js @@ -16,23 +16,23 @@ "use strict"; const capitalizeSentence = require("capitalize-sentence"); -const { isProfane, replaceProfanities } = import("no-profanity"); +const {isProfane, replaceProfanities} = import("no-profanity"); // Sanitizes the given text if needed by replacing bad words with '*'. exports.sanitizeText = (text) => { - // Re-capitalize if the user is Shouting. - if (isShouting(text)) { - console.log("User is shouting. Fixing sentence case..."); - text = stopShouting(text); - } + // Re-capitalize if the user is Shouting. + if (isShouting(text)) { + console.log("User is shouting. Fixing sentence case..."); + text = stopShouting(text); + } - // Moderate if the user uses SwearWords. - if (isProfane(text)) { - console.log("User is swearing. moderating..."); - text = replaceSwearwords(text); - } + // Moderate if the user uses SwearWords. + if (isProfane(text)) { + console.log("User is swearing. moderating..."); + text = replaceSwearwords(text); + } - return text; + return text; }; /** @@ -41,7 +41,7 @@ exports.sanitizeText = (text) => { * @return {string} */ function replaceSwearwords(message) { - return replaceProfanities(message); + return replaceProfanities(message); } /** @@ -51,7 +51,7 @@ function replaceSwearwords(message) { * @return {boolean} */ function isShouting(message) { - return message.replace(/[^A-Z]/g, "").length > message.length / 2 || message.replace(/[^!]/g, "").length >= 3; + return message.replace(/[^A-Z]/g, "").length > message.length / 2 || message.replace(/[^!]/g, "").length >= 3; } /** @@ -61,5 +61,5 @@ function isShouting(message) { * @return {string} capitalized string */ function stopShouting(message) { - return capitalizeSentence(message.toLowerCase()).replace(/!+/g, "."); + return capitalizeSentence(message.toLowerCase()).replace(/!+/g, "."); } From a4482253adb8a50bbc4d4e51da216666a942997c Mon Sep 17 00:00:00 2001 From: Rene Pot Date: Wed, 9 Aug 2023 08:48:22 +0100 Subject: [PATCH 3/4] chore: update version --- Node-1st-gen/text-moderation/functions/package.json | 2 +- Node/quickstarts/callable-functions/functions/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Node-1st-gen/text-moderation/functions/package.json b/Node-1st-gen/text-moderation/functions/package.json index 0851c1068b..bfee67359a 100644 --- a/Node-1st-gen/text-moderation/functions/package.json +++ b/Node-1st-gen/text-moderation/functions/package.json @@ -5,7 +5,7 @@ "capitalize-sentence": "^0.1.5", "firebase-admin": "^11.9.0", "firebase-functions": "^4.4.1", - "no-profanity": "^1.1.6" + "no-profanity": "^1.4.2" }, "devDependencies": { "eslint": "^8.40.0" diff --git a/Node/quickstarts/callable-functions/functions/package.json b/Node/quickstarts/callable-functions/functions/package.json index 9c7bec0d18..05e9907399 100644 --- a/Node/quickstarts/callable-functions/functions/package.json +++ b/Node/quickstarts/callable-functions/functions/package.json @@ -19,7 +19,7 @@ "capitalize-sentence": "^0.1.5", "firebase-admin": "^11.9.0", "firebase-functions": "^4.4.1", - "no-profanity": "^1.1.6" + "no-profanity": "^1.4.2" }, "devDependencies": { "eslint": "^8.40.0", From 4aaf63df2a667b037754a89d96bedf721cabad83 Mon Sep 17 00:00:00 2001 From: Rene Pot Date: Wed, 9 Aug 2023 21:28:04 +0100 Subject: [PATCH 4/4] Update package-lock.json --- package-lock.json | 129 +++++++++++++++++++++------------------------- 1 file changed, 58 insertions(+), 71 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1800f73f5a..0e82f081bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "Apache-2.0", "devDependencies": { - "eslint": "^8.40.0", + "eslint": "^8.44.0", "pnpm": "^8.2.0", "typescript": "^5.0.4" }, @@ -17,6 +17,15 @@ "node": "18" } }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -33,23 +42,23 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.1.tgz", - "integrity": "sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz", + "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.3.tgz", - "integrity": "sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.1.tgz", + "integrity": "sha512-9t7ZA7NGGK8ckelF0PQCfcxIUzs1Md5rrO6U/c+FIQNanea5UZC0wqKXH4vHBccmu4ZJgZ2idtPeW7+Q2npOEA==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.5.2", + "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -65,18 +74,18 @@ } }, "node_modules/@eslint/js": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.40.0.tgz", - "integrity": "sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.46.0.tgz", + "integrity": "sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", + "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -142,9 +151,9 @@ } }, "node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -335,27 +344,27 @@ } }, "node_modules/eslint": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.40.0.tgz", - "integrity": "sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.46.0.tgz", + "integrity": "sha512-cIO74PvbW0qU8e0mIvk5IV3ToWdCq5FYG6gWPHHkx6gNdjlbAYvtfHmlCMXxjcoVaIdwy/IAt3+mDkZkfvb2Dg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.0.3", - "@eslint/js": "8.40.0", - "@humanwhocodes/config-array": "^0.11.8", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.1", + "@eslint/js": "^8.46.0", + "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.0", - "eslint-visitor-keys": "^3.4.1", - "espree": "^9.5.2", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.2", + "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -363,22 +372,19 @@ "find-up": "^5.0.0", "glob-parent": "^6.0.2", "globals": "^13.19.0", - "grapheme-splitter": "^1.0.4", + "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", - "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" }, "bin": { @@ -392,9 +398,9 @@ } }, "node_modules/eslint-scope": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", - "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", @@ -408,9 +414,9 @@ } }, "node_modules/eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz", + "integrity": "sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -420,12 +426,12 @@ } }, "node_modules/espree": { - "version": "9.5.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz", - "integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "dependencies": { - "acorn": "^8.8.0", + "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.4.1" }, @@ -605,10 +611,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, "node_modules/has-flag": { @@ -706,16 +712,6 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, - "node_modules/js-sdsl": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", - "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/js-sdsl" - } - }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -808,17 +804,17 @@ } }, "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "type-check": "^0.4.0" }, "engines": { "node": ">= 0.8.0" @@ -1128,15 +1124,6 @@ "node": ">= 8" } }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",