From 8edf56f52388037317aff13b8fc9fe13062fa72c Mon Sep 17 00:00:00 2001 From: Varun Villait Date: Sun, 1 May 2022 18:19:16 -0700 Subject: [PATCH] Cleaner Errors with Codes and Messages (#24) * Cleaner Errors with Codes and Messages * reject in place * use built in 500 error * rename build workflow to test * fix errors and eslint * delete folder * eslint examples --- .github/workflows/publish.yaml | 4 +- .github/workflows/test.yaml | 2 +- example/index.js | 2 + example/package.json | 5 +- package.json | 8 +- src/endpoints/autocomplete/index.ts | 2 +- src/endpoints/cleaner/index.ts | 2 +- src/endpoints/enrichment/index.ts | 2 +- src/endpoints/retrieve/index.ts | 4 +- src/endpoints/search/index.ts | 2 +- src/errors.ts | 75 ++++++++---- tests/index.test.js | 173 +++++++++++++++++++++++++--- tsconfig.json | 4 +- yarn.lock | 140 +++++++++++----------- 14 files changed, 304 insertions(+), 121 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 43c2063..8573db4 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -5,7 +5,7 @@ on: types: [published] jobs: - build: + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -18,7 +18,7 @@ jobs: PDL_API_KEY: ${{secrets.PDL_API_KEY}} publish-npm: - needs: build + needs: test runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 84d3009..3dbd5e0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,7 +3,7 @@ name: Test Package on: [pull_request] jobs: - build: + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/example/index.js b/example/index.js index dc6c6d9..bd4b39d 100644 --- a/example/index.js +++ b/example/index.js @@ -1,3 +1,5 @@ +/* eslint no-console: "off" */ + import dotenv from 'dotenv'; import PDLJS from 'peopledatalabs'; diff --git a/example/package.json b/example/package.json index 111891d..ee6af0c 100644 --- a/example/package.json +++ b/example/package.json @@ -9,7 +9,8 @@ }, "author": "People Data Labs", "license": "MIT", - "devDependencies": { - "dotenv": "^14.2.0" + "dependencies": { + "dotenv": "^14.2.0", + "peopledatalabs": "*" } } diff --git a/package.json b/package.json index 01eb352..adefeb2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "peopledatalabs", - "version": "3.0.0", + "version": "3.1.0", "description": "JavaScript client with TypeScript support for the People Data Labs API", "type": "module", "main": "dist/index.cjs", @@ -10,9 +10,9 @@ "source": "src/index.ts", "scripts": { "build": "rm -rf dist && microbundle", - "dev": "microbundle watch", + "dev": "microbundle watch -p 6008", "test": "yarn run build && yarn run mocha", - "mocha": "mocha --recursive './tests/**/*.js'", + "mocha": "mocha --recursive 'tests/**/*.js'", "pub": "yarn run build && yarn publish" }, "repository": { @@ -54,7 +54,7 @@ "eslint-plugin-unused-imports": "^2.0.0", "esm": "^3.2.25", "microbundle": "^0.14.2", - "mocha": "^9.2.2", + "mocha": "^10.0.0", "typescript": "^4.6.3" }, "dependencies": { diff --git a/src/endpoints/autocomplete/index.ts b/src/endpoints/autocomplete/index.ts index 21c21b7..ddcec8d 100644 --- a/src/endpoints/autocomplete/index.ts +++ b/src/endpoints/autocomplete/index.ts @@ -40,6 +40,6 @@ export default ( reject(errorHandler(error)); }); }).catch((error) => { - reject(error.message); + reject(error); }); }); diff --git a/src/endpoints/cleaner/index.ts b/src/endpoints/cleaner/index.ts index b77f6aa..d511bf6 100644 --- a/src/endpoints/cleaner/index.ts +++ b/src/endpoints/cleaner/index.ts @@ -31,6 +31,6 @@ export default ( reject(errorHandler(error)); }); }).catch((error) => { - reject(error.message); + reject(error); }); }); diff --git a/src/endpoints/enrichment/index.ts b/src/endpoints/enrichment/index.ts index 10e3b98..689a2a2 100644 --- a/src/endpoints/enrichment/index.ts +++ b/src/endpoints/enrichment/index.ts @@ -31,6 +31,6 @@ export default ( reject(errorHandler(error)); }); }).catch((error) => { - reject(error.message); + reject(error); }); }); diff --git a/src/endpoints/retrieve/index.ts b/src/endpoints/retrieve/index.ts index 247158b..c042579 100644 --- a/src/endpoints/retrieve/index.ts +++ b/src/endpoints/retrieve/index.ts @@ -8,7 +8,7 @@ export default ( apiKey: string, params: RetrieveParams, ) => new Promise((resolve, reject) => { - check(params.id, basePath, apiKey, 'ID', 'retrieve').then(() => { + check(params, basePath, apiKey, 'ID', 'retrieve').then(() => { const headers = { 'Accept-Encoding': 'gzip', }; @@ -29,6 +29,6 @@ export default ( reject(errorHandler(error)); }); }).catch((error) => { - reject(error.message); + reject(error); }); }); diff --git a/src/endpoints/search/index.ts b/src/endpoints/search/index.ts index ba085f0..8586565 100644 --- a/src/endpoints/search/index.ts +++ b/src/endpoints/search/index.ts @@ -42,6 +42,6 @@ export default ( reject(errorHandler(error)); }); }).catch((error) => { - reject(error.message); + reject(error); }); }); diff --git a/src/errors.ts b/src/errors.ts index a76cbe6..868eb0b 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -2,6 +2,7 @@ import { AxiosError } from 'axios'; import { ErrorEndpoint } from './types/error-types'; import { BaseSearchParams } from './types/search-types'; import { AutoCompleteParams } from './types/autocomplete-types'; +import { RetrieveParams } from './types/retrieve-types'; const check = ( params: unknown, @@ -10,51 +11,85 @@ const check = ( type: string | null, endpoint: ErrorEndpoint, ) => new Promise((resolve, reject) => { - if (!params) reject(new Error(`Missing ${type || 'Params'}`)); + const error: { message?: string, status?: number } = { }; + + if (!params) { + error.message = `Missing ${type || 'Params'}`; + error.status = 400; + reject(error); + } + if (endpoint === 'search') { const { searchQuery } = params as BaseSearchParams; if (!searchQuery) { - reject(new Error('Missing searchQuery')); + error.message = 'Missing searchQuery'; + error.status = 400; + reject(error); } } + + if (endpoint === 'retrieve') { + const { id } = params as RetrieveParams; + if (!id) { + error.message = 'Missing id'; + error.status = 400; + reject(error); + } + } + if (endpoint === 'autocomplete') { const { field } = params as AutoCompleteParams; const validFields = ['company', 'country', 'industry', 'location', 'major', 'region', 'role', 'school', 'sub_role', 'skill', 'title']; if (!field) { - reject(new Error('Missing field')); + error.message = 'Missing field'; + error.status = 400; + reject(error); } else if (validFields.indexOf(field) === -1) { - reject(new Error(`field should be one of: ${validFields}`)); + error.message = `field should be one of: ${validFields}`; + error.status = 400; + reject(error); } } - if (!basePath) reject(new Error('Invalid API Base Path')); - if (!apiKey || apiKey.length !== 64) reject(new Error('Invalid API Key')); + + if (!basePath) { + error.message = 'Missing API Base Path'; + error.status = 400; + reject(error); + } + + if (!apiKey || apiKey.length !== 64) { + error.message = 'Invalid API Key'; + error.status = 401; + reject(error); + } + resolve(); }); const errorHandler = (error: AxiosError) => { + const errorMessages = { + 400: 'Request contained either missing or invalid parameters', + 401: 'Request contained a missing or invalid key', + 402: 'Payment Required, You have hit your account maximum (all matches used)', + 404: 'No records were found matching your request', + 405: 'Request method is not allowed on the requested resource', + 429: 'An error occurred due to requests hitting the API too quick', + 500: 'The server encountered an unexpected condition which prevented it from fulfilling the request', + }; + if (error.response) { const { status } = error.response; - - const errorMessages = { - 400: 'Request contained either missing or invalid parameters', - 401: 'Request contained a missing or invalid key', - 402: 'Payment Required, You have hit your account maximum (all matches used)', - 404: 'No records were found matching your request', - 405: 'Request method is not allowed on the requested resource', - 429: 'An error occurred due to requests hitting the API too quick', - 500: 'The server encountered an unexpected condition which prevented it from fulfilling the request', - }; + const statusCode = status >= 500 && status < 600 ? 500 : status; return ({ - status: status >= 500 && status < 600 ? 500 : status, - // eslint-disable-next-line max-len - message: errorMessages[status >= 500 && status < 600 ? 500 : status as keyof typeof errorMessages], + status: statusCode, + message: errorMessages[statusCode as keyof typeof errorMessages], }); } return ({ status: 500, - message: error.message, + message: errorMessages[500], }); }; diff --git a/tests/index.test.js b/tests/index.test.js index 04076f6..9eae50d 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -1,5 +1,8 @@ +/* eslint-env mocha */ + import { expect } from 'chai'; import dotenv from 'dotenv'; +// eslint-disable-next-line import PDLJS from '../dist/index.m.js'; dotenv.config({ path: './.env.local' }); @@ -72,7 +75,18 @@ describe('Person Enrichment', () => { expect(data).to.be.a('object'); done(); }).catch((error) => { - expect(error).to.be.a('string'); + expect(error).to.be.a('object'); + done(); + }); + }); + + it('Should Error for Person Enrichment', (done) => { + PDLJSClient.person.enrichment().then((data) => { + expect(data.status).to.equal(200); + expect(data).to.be.a('object'); + done(); + }).catch((error) => { + expect(error).to.be.a('object'); done(); }); }); @@ -85,7 +99,19 @@ describe('Person Identify', () => { expect(data).to.be.a('object'); done(); }).catch((error) => { - expect(error).to.be.a('string'); + expect(error).to.be.a('object'); + done(); + }); + }); + + it('Should Error for Person Identify', (done) => { + PDLJSClient.person.identify().then((data) => { + expect(data.status).to.equal(200); + expect(data).to.be.a('object'); + done(); + }).catch((error) => { + expect(error).to.be.a('object'); + done(); }); }); }); @@ -97,7 +123,18 @@ describe('Person Bulk', () => { expect(data.items).to.be.a('array'); done(); }).catch((error) => { - expect(error).to.be.a('string'); + expect(error).to.be.a('object'); + done(); + }); + }); + + it('Should Error for Person Bulk', (done) => { + PDLJSClient.person.bulk().then((data) => { + expect(data.items.length).to.equal(2); + expect(data.items).to.be.a('array'); + done(); + }).catch((error) => { + expect(error).to.be.a('object'); done(); }); }); @@ -110,7 +147,18 @@ describe('Person Search', () => { expect(data).to.be.a('object'); done(); }).catch((error) => { - expect(error).to.be.a('string'); + expect(error).to.be.a('object'); + done(); + }); + }); + + it('Should Error for Person Search (sql)', (done) => { + PDLJSClient.person.search.sql().then((data) => { + expect(data.status).to.equal(200); + expect(data).to.be.a('object'); + done(); + }).catch((error) => { + expect(error).to.be.a('object'); done(); }); }); @@ -121,7 +169,18 @@ describe('Person Search', () => { expect(data).to.be.a('object'); done(); }).catch((error) => { - expect(error).to.be.a('string'); + expect(error).to.be.a('object'); + done(); + }); + }); + + it('Should Error for Person Search (elastic)', (done) => { + PDLJSClient.person.search.elastic().then((data) => { + expect(data.status).to.equal(200); + expect(data).to.be.a('object'); + done(); + }).catch((error) => { + expect(error).to.be.a('object'); done(); }); }); @@ -134,7 +193,18 @@ describe('Person Retrieve', () => { expect(data).to.be.a('object'); done(); }).catch((error) => { - expect(error).to.be.a('string'); + expect(error).to.be.a('object'); + done(); + }); + }); + + it('Should Error for Person Retrieve', (done) => { + PDLJSClient.person.retrieve().then((data) => { + expect(data.status).to.equal(200); + expect(data).to.be.a('object'); + done(); + }).catch((error) => { + expect(error).to.be.a('object'); done(); }); }); @@ -147,7 +217,18 @@ describe('Company Enrichment', () => { expect(data).to.be.a('object'); done(); }).catch((error) => { - expect(error).to.be.a('string'); + expect(error).to.be.a('object'); + done(); + }); + }); + + it('Should Error for Company Enrichment', (done) => { + PDLJSClient.company.enrichment().then((data) => { + expect(data.status).to.equal(200); + expect(data).to.be.a('object'); + done(); + }).catch((error) => { + expect(error).to.be.a('object'); done(); }); }); @@ -160,7 +241,18 @@ describe('Company Search', () => { expect(data).to.be.a('object'); done(); }).catch((error) => { - expect(error).to.be.a('string'); + expect(error).to.be.a('object'); + done(); + }); + }); + + it('Should Error for Company Search (sql)', (done) => { + PDLJSClient.company.search.sql().then((data) => { + expect(data.status).to.equal(200); + expect(data).to.be.a('object'); + done(); + }).catch((error) => { + expect(error).to.be.a('object'); done(); }); }); @@ -171,7 +263,18 @@ describe('Company Search', () => { expect(data).to.be.a('object'); done(); }).catch((error) => { - expect(error).to.be.a('string'); + expect(error).to.be.a('object'); + done(); + }); + }); + + it('Should Error for Company Search (elastic)', (done) => { + PDLJSClient.company.search.elastic().then((data) => { + expect(data.status).to.equal(200); + expect(data).to.be.a('object'); + done(); + }).catch((error) => { + expect(error).to.be.a('object'); done(); }); }); @@ -184,7 +287,18 @@ describe('Autocomplete', () => { expect(data).to.be.a('object'); done(); }).catch((error) => { - expect(error).to.be.a('string'); + expect(error).to.be.a('object'); + done(); + }); + }); + + it('Should Error for Autocomplete', (done) => { + PDLJSClient.autocomplete().then((data) => { + expect(data.status).to.equal(200); + expect(data).to.be.a('object'); + done(); + }).catch((error) => { + expect(error).to.be.a('object'); done(); }); }); @@ -197,7 +311,18 @@ describe('Cleaner APIs', () => { expect(data).to.be.a('object'); done(); }).catch((error) => { - expect(error).to.be.a('string'); + expect(error).to.be.a('object'); + done(); + }); + }); + + it('Should Error for Company Cleaner', (done) => { + PDLJSClient.company.cleaner().then((data) => { + expect(data.status).to.equal(200); + expect(data).to.be.a('object'); + done(); + }).catch((error) => { + expect(error).to.be.a('object'); done(); }); }); @@ -208,7 +333,18 @@ describe('Cleaner APIs', () => { expect(data).to.be.a('object'); done(); }).catch((error) => { - expect(error).to.be.a('string'); + expect(error).to.be.a('object'); + done(); + }); + }); + + it('Should Error for Location Cleaner', (done) => { + PDLJSClient.location.cleaner().then((data) => { + expect(data.status).to.equal(200); + expect(data).to.be.a('object'); + done(); + }).catch((error) => { + expect(error).to.be.a('object'); done(); }); }); @@ -219,7 +355,18 @@ describe('Cleaner APIs', () => { expect(data).to.be.a('object'); done(); }).catch((error) => { - expect(error).to.be.a('string'); + expect(error).to.be.a('object'); + done(); + }); + }); + + it('Should Error for School Cleaner', (done) => { + PDLJSClient.school.cleaner().then((data) => { + expect(data.status).to.equal(200); + expect(data).to.be.a('object'); + done(); + }).catch((error) => { + expect(error).to.be.a('object'); done(); }); }); diff --git a/tsconfig.json b/tsconfig.json index 95bfc01..376d238 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,6 +19,6 @@ "module": "ESNext", "target": "ESNext" }, - "include": ["src/**/*"], - "exclude": ["dist", "examples", "tests", "node_modules"] + "include": ["src/**/*", "tests", "example"], + "exclude": ["dist", "node_modules"] } diff --git a/yarn.lock b/yarn.lock index 3eb85af..f5e411d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1252,7 +1252,7 @@ "@ungap/promise-all-settled@1.1.2": version "1.1.2" - resolved "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz" + resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== acorn-jsx@^5.3.1: @@ -1316,7 +1316,7 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: anymatch@~3.1.2: version "3.1.2" - resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== dependencies: normalize-path "^3.0.0" @@ -1477,7 +1477,7 @@ balanced-match@^1.0.0: binary-extensions@^2.0.0: version "2.2.0" - resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== boolbase@^1.0.0: @@ -1516,7 +1516,7 @@ brotli-size@^4.0.0: browser-stdout@1.3.1: version "1.3.1" - resolved "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== browserslist@^4.0.0, browserslist@^4.16.6, browserslist@^4.17.5, browserslist@^4.19.1: @@ -1575,7 +1575,7 @@ caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001297, caniuse-lite@^1.0.30001312: chai@^4.3.6: version "4.3.6" - resolved "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.6.tgz#ffe4ba2d9fa9d6680cc0b370adae709ec9011e9c" integrity sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q== dependencies: assertion-error "^1.1.0" @@ -1621,7 +1621,7 @@ check-error@^1.0.2: chokidar@3.5.3: version "3.5.3" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== dependencies: anymatch "~3.1.2" @@ -1636,7 +1636,7 @@ chokidar@3.5.3: cliui@^7.0.2: version "7.0.4" - resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== dependencies: string-width "^4.2.0" @@ -1841,10 +1841,10 @@ damerau-levenshtein@^1.0.7: resolved "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz" integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== -debug@4.3.3, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2: - version "4.3.3" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== +debug@4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" @@ -1862,9 +1862,16 @@ debug@^3.2.7: dependencies: ms "^2.1.1" +debug@^4.1.0, debug@^4.1.1, debug@^4.3.2: + version "4.3.3" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz" + integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== + dependencies: + ms "2.1.2" + decamelize@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== deep-eql@^3.0.1: @@ -1893,7 +1900,7 @@ define-properties@^1.1.3: diff@5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== dir-glob@^3.0.1: @@ -1976,7 +1983,7 @@ electron-to-chromium@^1.4.71: emoji-regex@^8.0.0: version "8.0.0" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== emoji-regex@^9.2.2: @@ -2386,7 +2393,7 @@ find-cache-dir@^3.3.1: find-up@5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== dependencies: locate-path "^6.0.0" @@ -2417,7 +2424,7 @@ flat-cache@^3.0.4: flat@^5.0.2: version "5.0.2" - resolved "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== flatted@^3.1.0: @@ -2478,7 +2485,7 @@ gensync@^1.0.0-beta.2: get-caller-file@^2.0.5: version "2.0.5" - resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== get-func-name@^2.0.0: @@ -2568,11 +2575,6 @@ graceful-fs@^4.1.6, graceful-fs@^4.2.0: resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz" integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== -growl@1.10.5: - version "1.10.5" - resolved "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - gzip-size@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/gzip-size/-/gzip-size-3.0.0.tgz" @@ -2630,7 +2632,7 @@ has@^1.0.3: he@1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== icss-replace-symbols@^1.1.0: @@ -2711,7 +2713,7 @@ is-bigint@^1.0.1: is-binary-path@~2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== dependencies: binary-extensions "^2.0.0" @@ -2750,7 +2752,7 @@ is-extglob@^2.1.1: is-fullwidth-code-point@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: @@ -2784,7 +2786,7 @@ is-number@^7.0.0: is-plain-obj@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== is-reference@^1.2.1: @@ -2823,7 +2825,7 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: is-unicode-supported@^0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== is-weakref@^1.0.1: @@ -2980,7 +2982,7 @@ locate-path@^5.0.0: locate-path@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== dependencies: p-locate "^5.0.0" @@ -3012,7 +3014,7 @@ lodash.uniq@^4.5.0: log-symbols@4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== dependencies: chalk "^4.1.0" @@ -3133,12 +3135,12 @@ micromatch@^4.0.4: braces "^3.0.2" picomatch "^2.3.1" -minimatch@4.2.1: - version "4.2.1" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz" - integrity sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g== +minimatch@5.0.1, minimatch@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" + integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== dependencies: - brace-expansion "^1.1.7" + brace-expansion "^2.0.1" minimatch@^3.0.4, minimatch@^3.1.2: version "3.1.2" @@ -3147,44 +3149,35 @@ minimatch@^3.0.4, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" - integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== - dependencies: - brace-expansion "^2.0.1" - minimist@^1.2.0, minimist@^1.2.5: version "1.2.5" resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== -mocha@^9.2.2: - version "9.2.2" - resolved "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz" - integrity sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g== +mocha@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.0.0.tgz#205447d8993ec755335c4b13deba3d3a13c4def9" + integrity sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA== dependencies: "@ungap/promise-all-settled" "1.1.2" ansi-colors "4.1.1" browser-stdout "1.3.1" chokidar "3.5.3" - debug "4.3.3" + debug "4.3.4" diff "5.0.0" escape-string-regexp "4.0.0" find-up "5.0.0" glob "7.2.0" - growl "1.10.5" he "1.2.0" js-yaml "4.1.0" log-symbols "4.1.0" - minimatch "4.2.1" + minimatch "5.0.1" ms "2.1.3" - nanoid "3.3.1" + nanoid "3.3.3" serialize-javascript "6.0.0" strip-json-comments "3.1.1" supports-color "8.1.1" - which "2.0.2" - workerpool "6.2.0" + workerpool "6.2.1" yargs "16.2.0" yargs-parser "20.2.4" yargs-unparser "2.0.0" @@ -3209,7 +3202,12 @@ ms@2.1.3, ms@^2.1.1: resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -nanoid@3.3.1, nanoid@^3.3.1: +nanoid@3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" + integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== + +nanoid@^3.3.1: version "3.3.1" resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz" integrity sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw== @@ -3226,7 +3224,7 @@ node-releases@^2.0.2: normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== normalize-range@^0.1.2: @@ -3351,7 +3349,7 @@ p-limit@^2.2.0: p-limit@^3.0.2: version "3.1.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== dependencies: yocto-queue "^0.1.0" @@ -3372,7 +3370,7 @@ p-locate@^4.1.0: p-locate@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== dependencies: p-limit "^3.0.2" @@ -3799,7 +3797,7 @@ react-is@^16.13.1: readdirp@~3.6.0: version "3.6.0" - resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== dependencies: picomatch "^2.2.1" @@ -3867,7 +3865,7 @@ regjsparser@^0.8.2: require-directory@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= resolve-from@^4.0.0: @@ -4026,7 +4024,7 @@ semver@^7.3.5: serialize-javascript@6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== dependencies: randombytes "^2.1.0" @@ -4185,7 +4183,7 @@ stylehacks@^5.1.0: supports-color@8.1.1: version "8.1.1" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== dependencies: has-flag "^4.0.0" @@ -4392,7 +4390,7 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" -which@2.0.2, which@^2.0.1: +which@^2.0.1: version "2.0.2" resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== @@ -4404,14 +4402,14 @@ word-wrap@^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== -workerpool@6.2.0: - version "6.2.0" - resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz" - integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== +workerpool@6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" + integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== wrap-ansi@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== dependencies: ansi-styles "^4.0.0" @@ -4425,7 +4423,7 @@ wrappy@1: y18n@^5.0.5: version "5.0.8" - resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== yallist@^4.0.0: @@ -4440,17 +4438,17 @@ yaml@^1.10.0, yaml@^1.10.2: yargs-parser@20.2.4: version "20.2.4" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== yargs-parser@^20.2.2: version "20.2.9" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== yargs-unparser@2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== dependencies: camelcase "^6.0.0" @@ -4460,7 +4458,7 @@ yargs-unparser@2.0.0: yargs@16.2.0: version "16.2.0" - resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== dependencies: cliui "^7.0.2" @@ -4473,5 +4471,5 @@ yargs@16.2.0: yocto-queue@^0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==