diff --git a/package.json b/package.json index fe8a452..ce542b0 100644 --- a/package.json +++ b/package.json @@ -118,8 +118,7 @@ "test-compile": "tsc -p ./", "lint": "eslint \"src/**/*.ts\"", "compile": "npm run esbuild", - "package-for-vscode": "vsce package --dependencies", - "update-vendored": "npm --prefix=./vendor -g i '@socketsecurity/cli'" + "package-for-vscode": "vsce package --dependencies" }, "dependencies": { "@babel/parser": "^7.20.7", diff --git a/vendor/bin/socket b/vendor/bin/socket deleted file mode 120000 index ea60d4b..0000000 --- a/vendor/bin/socket +++ /dev/null @@ -1 +0,0 @@ -../lib/node_modules/@socketsecurity/cli/cli.js \ No newline at end of file diff --git a/vendor/lib/node_modules/@socketsecurity/cli/LICENSE b/vendor/lib/node_modules/@socketsecurity/cli/LICENSE deleted file mode 100644 index e4c00a2..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2022 Socket Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/lib/node_modules/@socketsecurity/cli/README.md b/vendor/lib/node_modules/@socketsecurity/cli/README.md deleted file mode 100644 index 8bccbac..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# Socket CLI - -[![npm version](https://img.shields.io/npm/v/@socketsecurity/cli.svg?style=flat)](https://www.npmjs.com/package/@socketsecurity/cli) -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/SocketDev/eslint-config) -[![Follow @SocketSecurity](https://img.shields.io/twitter/follow/SocketSecurity?style=social)](https://twitter.com/SocketSecurity) - -CLI tool for [Socket.dev](https://socket.dev/) - -## Usage - -```bash -npm install -g @socketsecurity/cli -``` - -```bash -socket --help -socket info webtorrent@1.9.1 -socket report create package.json --view -socket report view QXU8PmK7LfH608RAwfIKdbcHgwEd_ZeWJ9QEGv05FJUQ -``` - -## Commands - -* `socket info ` - looks up issues for a package - -* `socket report create ` - creates a report on [socket.dev](https://socket.dev/) - - Uploads the specified `package.json` and lock files and, if any folder is specified, the ones found in there. Also includes the complementary `package.json` and lock file to any specified. Currently `package-lock.json` and `yarn.lock` are supported. - - Supports globbing such as `**/package.json`. - - Ignores any file specified in your project's `.gitignore`, the `projectIgnorePaths` in your project's [`socket.yml`](https://docs.socket.dev/docs/socket-yml) and on top of that has a sensible set of [default ignores](https://www.npmjs.com/package/ignore-by-default) - -* `socket report view ` - looks up issues and scores from a report - -## Flags - -### Command specific flags - -* `--view` - when set on `socket report create` the command will immediately do a `socket report view` style view of the created report, waiting for the server to complete it - -### Output flags - -* `--json` - outputs result as json which you can then pipe into [`jq`](https://stedolan.github.io/jq/) and other tools -* `--markdown` - outputs result as markdown which you can then copy into an issue, PR or even chat - -## Strictness flags - -* `--all` - by default only `high` and `critical` issues are included, by setting this flag all issues will be included -* `--strict` - when set, exits with an error code if any issues were found - -### Other flags - -* `--dry-run` - like all CLI tools that perform an action should have, we have a dry run flag. Eg. `socket report create` supports running the command without actually uploading anything -* `--debug` - outputs additional debug output. Great for debugging, geeks and us who develop. Hopefully you will never _need_ it, but it can still be fun, right? -* `--help` - prints the help for the current command. All CLI tools should have this flag -* `--version` - prints the version of the tool. All CLI tools should have this flag - -## Configuration files - -The CLI reads and uses data from a [`socket.yml` file](https://docs.socket.dev/docs/socket-yml) in the folder you run it in. It supports the version 2 of the `socket.yml` file format and makes use of the `projectIgnorePaths` to excludes files when creating a report. - -## Environment variables - -* `SOCKET_SECURITY_API_KEY` - if set, this will be used as the API-key - -## Contributing - -### Environment variables for development - -* `SOCKET_SECURITY_API_BASE_URL` - if set, this will be the base for all API-calls. Defaults to `https://api.socket.dev/v0/` -* `SOCKET_SECURITY_API_PROXY` - if set to something like [`http://127.0.0.1:9090`](https://docs.proxyman.io/troubleshooting/couldnt-see-any-requests-from-3rd-party-network-libraries), then all request will be proxied through that proxy - -## Similar projects - -* [`@socketsecurity/sdk`](https://github.com/SocketDev/socket-sdk-js) - the SDK used in this CLI - -## See also - -* [Announcement blog post](https://socket.dev/blog/announcing-socket-cli-preview) -* [Socket API Reference](https://docs.socket.dev/reference) - the API used in this CLI -* [Socket GitHub App](https://github.com/apps/socket-security) - the plug-and-play GitHub App diff --git a/vendor/lib/node_modules/@socketsecurity/cli/cli.js b/vendor/lib/node_modules/@socketsecurity/cli/cli.js deleted file mode 100755 index 52ea910..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/cli.js +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable no-console */ - -import chalk from 'chalk' -import { messageWithCauses, stackWithCauses } from 'pony-cause' - -import * as cliCommands from './lib/commands/index.js' -import { logSymbols } from './lib/utils/chalk-markdown.js' -import { AuthError, InputError } from './lib/utils/errors.js' -import { meowWithSubcommands } from './lib/utils/meow-with-subcommands.js' -import { initUpdateNotifier } from './lib/utils/update-notifier.js' - -// TODO: Add autocompletion using https://www.npmjs.com/package/omelette - -initUpdateNotifier() - -try { - await meowWithSubcommands( - cliCommands, - { - argv: process.argv.slice(2), - name: 'socket', - importMeta: import.meta - } - ) -} catch (err) { - /** @type {string} */ - let errorTitle - /** @type {string} */ - let errorMessage = '' - /** @type {string|undefined} */ - let errorBody - - if (err instanceof AuthError) { - errorTitle = 'Authentication error' - errorMessage = err.message - } else if (err instanceof InputError) { - errorTitle = 'Invalid input' - errorMessage = err.message - errorBody = err.body - } else if (err instanceof Error) { - errorTitle = 'Unexpected error' - errorMessage = messageWithCauses(err) - errorBody = stackWithCauses(err) - } else { - errorTitle = 'Unexpected error with no details' - } - - console.error(`${logSymbols.error} ${chalk.white.bgRed(errorTitle + ':')} ${errorMessage}`) - if (errorBody) { - console.error('\n' + errorBody) - } - - process.exit(1) -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/lib/commands/index.js b/vendor/lib/node_modules/@socketsecurity/cli/lib/commands/index.js deleted file mode 100644 index 6a05663..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/lib/commands/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export * from './info/index.js' -export * from './report/index.js' diff --git a/vendor/lib/node_modules/@socketsecurity/cli/lib/commands/info/index.js b/vendor/lib/node_modules/@socketsecurity/cli/lib/commands/info/index.js deleted file mode 100644 index 6cac454..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/lib/commands/info/index.js +++ /dev/null @@ -1,191 +0,0 @@ -/* eslint-disable no-console */ - -import chalk from 'chalk' -import meow from 'meow' -import ora from 'ora' - -import { handleApiCall, handleUnsuccessfulApiResponse } from '../../utils/api-helpers.js' -import { ChalkOrMarkdown } from '../../utils/chalk-markdown.js' -import { InputError } from '../../utils/errors.js' -import { getSeverityCount, formatSeverityCount } from '../../utils/format-issues.js' -import { printFlagList } from '../../utils/formatting.js' -import { objectSome } from '../../utils/misc.js' -import { setupSdk } from '../../utils/sdk.js' - -/** @type {import('../../utils/meow-with-subcommands').CliSubcommand} */ -export const info = { - description: 'Look up info regarding a package', - async run (argv, importMeta, { parentName }) { - const name = parentName + ' info' - - const input = setupCommand(name, info.description, argv, importMeta) - const packageData = input && await fetchPackageData(input.pkgName, input.pkgVersion, input) - - if (packageData) { - formatPackageDataOutput(packageData, { name, ...input }) - } - } -} - -// Internal functions - -/** - * @typedef CommandContext - * @property {boolean} includeAllIssues - * @property {boolean} outputJson - * @property {boolean} outputMarkdown - * @property {string} pkgName - * @property {string} pkgVersion - * @property {boolean} strict - */ - -/** - * @param {string} name - * @param {string} description - * @param {readonly string[]} argv - * @param {ImportMeta} importMeta - * @returns {void|CommandContext} - */ -function setupCommand (name, description, argv, importMeta) { - const cli = meow(` - Usage - $ ${name} - - Options - ${printFlagList({ - '--all': 'Include all issues', - '--json': 'Output result as json', - '--markdown': 'Output result as markdown', - '--strict': 'Exits with an error code if any matching issues are found', - }, 6)} - - Examples - $ ${name} webtorrent - $ ${name} webtorrent@1.9.1 - `, { - argv, - description, - importMeta, - flags: { - all: { - type: 'boolean', - default: false, - }, - json: { - type: 'boolean', - alias: 'j', - default: false, - }, - markdown: { - type: 'boolean', - alias: 'm', - default: false, - }, - strict: { - type: 'boolean', - default: false, - }, - } - }) - - const { - all: includeAllIssues, - json: outputJson, - markdown: outputMarkdown, - strict, - } = cli.flags - - if (cli.input.length > 1) { - throw new InputError('Only one package lookup supported at once') - } - - const [rawPkgName = ''] = cli.input - - if (!rawPkgName) { - cli.showHelp() - return - } - - const versionSeparator = rawPkgName.lastIndexOf('@') - - if (versionSeparator < 1) { - throw new InputError('Need to specify a full package identifier, like eg: webtorrent@1.0.0') - } - - const pkgName = rawPkgName.slice(0, versionSeparator) - const pkgVersion = rawPkgName.slice(versionSeparator + 1) - - if (!pkgVersion) { - throw new InputError('Need to specify a version, like eg: webtorrent@1.0.0') - } - - return { - includeAllIssues, - outputJson, - outputMarkdown, - pkgName, - pkgVersion, - strict, - } -} - -/** - * @typedef PackageData - * @property {import('@socketsecurity/sdk').SocketSdkReturnType<'getIssuesByNPMPackage'>["data"]} data - * @property {Record} severityCount - */ - -/** - * @param {string} pkgName - * @param {string} pkgVersion - * @param {Pick} context - * @returns {Promise} - */ -async function fetchPackageData (pkgName, pkgVersion, { includeAllIssues, strict }) { - const socketSdk = await setupSdk() - const spinner = ora(`Looking up data for version ${pkgVersion} of ${pkgName}`).start() - const result = await handleApiCall(socketSdk.getIssuesByNPMPackage(pkgName, pkgVersion), spinner, 'looking up package') - - if (result.success === false) { - return handleUnsuccessfulApiResponse(result, spinner) - } - - // Conclude the status of the API call - - const severityCount = getSeverityCount(result.data, includeAllIssues ? undefined : 'high') - - if (objectSome(severityCount)) { - const issueSummary = formatSeverityCount(severityCount) - spinner[strict ? 'fail' : 'succeed'](`Package has these issues: ${issueSummary}`) - } else { - spinner.succeed('Package has no issues') - } - - return { - data: result.data, - severityCount, - } -} - -/** - * @param {PackageData} packageData - * @param {{ name: string } & CommandContext} context - * @returns {void} - */ - function formatPackageDataOutput ({ data, severityCount }, { name, outputJson, outputMarkdown, pkgName, pkgVersion, strict }) { - if (outputJson) { - console.log(JSON.stringify(data, undefined, 2)) - } else { - const format = new ChalkOrMarkdown(!!outputMarkdown) - const url = `https://socket.dev/npm/package/${pkgName}/overview/${pkgVersion}` - - console.log('\nDetailed info on socket.dev: ' + format.hyperlink(`${pkgName} v${pkgVersion}`, url, { fallbackToUrl: true })) - if (!outputMarkdown) { - console.log(chalk.dim('\nOr rerun', chalk.italic(name), 'using the', chalk.italic('--json'), 'flag to get full JSON output')) - } - } - - if (strict && objectSome(severityCount)) { - process.exit(1) - } -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/lib/commands/report/create.js b/vendor/lib/node_modules/@socketsecurity/cli/lib/commands/report/create.js deleted file mode 100644 index 563b403..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/lib/commands/report/create.js +++ /dev/null @@ -1,247 +0,0 @@ -/* eslint-disable no-console */ - -import path from 'node:path' - -import { betterAjvErrors } from '@apideck/better-ajv-errors' -import { readSocketConfig, SocketValidationError } from '@socketsecurity/config' -import meow from 'meow' -import ora from 'ora' -import { ErrorWithCause } from 'pony-cause' - -import { handleApiCall, handleUnsuccessfulApiResponse } from '../../utils/api-helpers.js' -import { ChalkOrMarkdown, logSymbols } from '../../utils/chalk-markdown.js' -import { InputError } from '../../utils/errors.js' -import { printFlagList } from '../../utils/formatting.js' -import { createDebugLogger } from '../../utils/misc.js' -import { getPackageFiles } from '../../utils/path-resolve.js' -import { setupSdk } from '../../utils/sdk.js' -import { fetchReportData, formatReportDataOutput } from './view.js' - -/** @type {import('../../utils/meow-with-subcommands').CliSubcommand} */ -export const create = { - description: 'Create a project report', - async run (argv, importMeta, { parentName }) { - const name = parentName + ' create' - - const input = await setupCommand(name, create.description, argv, importMeta) - - if (input) { - const { - cwd, - debugLog, - dryRun, - includeAllIssues, - outputJson, - outputMarkdown, - packagePaths, - strict, - view, - } = input - - const result = input && await createReport(packagePaths, { cwd, debugLog, dryRun }) - - if (result && view) { - const reportId = result.data.id - const reportData = input && await fetchReportData(reportId, { includeAllIssues, strict }) - - if (reportData) { - formatReportDataOutput(reportData, { includeAllIssues, name, outputJson, outputMarkdown, reportId, strict }) - } - } else if (result) { - formatReportCreationOutput(result.data, { outputJson, outputMarkdown }) - } - } - } -} - -// Internal functions - -/** - * @typedef CommandContext - * @property {string} cwd - * @property {typeof console.error} debugLog - * @property {boolean} dryRun - * @property {boolean} includeAllIssues - * @property {boolean} outputJson - * @property {boolean} outputMarkdown - * @property {string[]} packagePaths - * @property {boolean} strict - * @property {boolean} view - */ - -/** - * @param {string} name - * @param {string} description - * @param {readonly string[]} argv - * @param {ImportMeta} importMeta - * @returns {Promise} - */ -async function setupCommand (name, description, argv, importMeta) { - const cli = meow(` - Usage - $ ${name} - - Uploads the specified "package.json" and lock files and, if any folder is - specified, the ones found in there. Also includes the complementary - "package.json" and lock file to any specified. Currently "package-lock.json" - and "yarn.lock" are supported. - - Supports globbing such as "**/package.json". - - Ignores any file specified in your project's ".gitignore", your project's - "socket.yml" file's "projectIgnorePaths" and also has a sensible set of - default ignores from the "ignore-by-default" module. - - Options - ${printFlagList({ - '--all': 'Include all issues', - '--debug': 'Output debug information', - '--dry-run': 'Only output what will be done without actually doing it', - '--json': 'Output result as json', - '--markdown': 'Output result as markdown', - '--strict': 'Exits with an error code if any matching issues are found', - '--view': 'Will wait for and return the created report' - }, 6)} - - Examples - $ ${name} . - $ ${name} '**/package.json' - $ ${name} /path/to/a/package.json /path/to/another/package.json - $ ${name} . --view --json - `, { - argv, - description, - importMeta, - flags: { - all: { - type: 'boolean', - default: false, - }, - debug: { - type: 'boolean', - alias: 'd', - default: false, - }, - dryRun: { - type: 'boolean', - default: false, - }, - json: { - type: 'boolean', - alias: 'j', - default: false, - }, - markdown: { - type: 'boolean', - alias: 'm', - default: false, - }, - strict: { - type: 'boolean', - default: false, - }, - view: { - type: 'boolean', - alias: 'v', - default: false, - }, - } - }) - - const { - all: includeAllIssues, - dryRun, - json: outputJson, - markdown: outputMarkdown, - strict, - view, - } = cli.flags - - if (!cli.input[0]) { - cli.showHelp() - return - } - - const debugLog = createDebugLogger(dryRun || cli.flags.debug) - - // TODO: Allow setting a custom cwd and/or configFile path? - const cwd = process.cwd() - const absoluteConfigPath = path.join(cwd, 'socket.yml') - - const config = await readSocketConfig(absoluteConfigPath) - .catch(/** @param {unknown} cause */ cause => { - if (cause && typeof cause === 'object' && cause instanceof SocketValidationError) { - // Inspired by workbox-build: https://github.com/GoogleChrome/workbox/blob/95f97a207fd51efb3f8a653f6e3e58224183a778/packages/workbox-build/src/lib/validate-options.ts#L68-L71 - const betterErrors = betterAjvErrors({ - basePath: 'config', - data: cause.data, - errors: cause.validationErrors, - // @ts-ignore - schema: cause.schema, - }) - throw new InputError( - 'The socket.yml config is not valid', - betterErrors.map((err) => `[${err.path}] ${err.message}.${err.suggestion ? err.suggestion : ''}`).join('\n') - ) - } else { - throw new ErrorWithCause('Failed to read socket.yml config', { cause }) - } - }) - - const packagePaths = await getPackageFiles(cwd, cli.input, config, debugLog) - - return { - cwd, - debugLog, - dryRun, - includeAllIssues, - outputJson, - outputMarkdown, - packagePaths, - strict, - view, - } -} - -/** - * @param {string[]} packagePaths - * @param {Pick} context - * @returns {Promise>} - */ -async function createReport (packagePaths, { cwd, debugLog, dryRun }) { - debugLog('Uploading:', packagePaths.join(`\n${logSymbols.info} Uploading: `)) - - if (dryRun) { - return - } - - const socketSdk = await setupSdk() - const spinner = ora(`Creating report with ${packagePaths.length} package files`).start() - const result = await handleApiCall(socketSdk.createReportFromFilePaths(packagePaths, cwd), spinner, 'creating report') - - if (result.success === false) { - return handleUnsuccessfulApiResponse(result, spinner) - } - - // Conclude the status of the API call - - spinner.succeed() - - return result -} - -/** - * @param {import('@socketsecurity/sdk').SocketSdkReturnType<'createReport'>["data"]} data - * @param {Pick} context - * @returns {void} - */ -function formatReportCreationOutput (data, { outputJson, outputMarkdown }) { - if (outputJson) { - console.log(JSON.stringify(data, undefined, 2)) - return - } - - const format = new ChalkOrMarkdown(!!outputMarkdown) - - console.log('\nNew report: ' + format.hyperlink(data.id, data.url, { fallbackToUrl: true })) -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/lib/commands/report/index.js b/vendor/lib/node_modules/@socketsecurity/cli/lib/commands/report/index.js deleted file mode 100644 index 2a2b12f..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/lib/commands/report/index.js +++ /dev/null @@ -1,24 +0,0 @@ -import { meowWithSubcommands } from '../../utils/meow-with-subcommands.js' -import { create } from './create.js' -import { view } from './view.js' - -const description = 'Project report related commands' - -/** @type {import('../../utils/meow-with-subcommands').CliSubcommand} */ -export const report = { - description, - run: async (argv, importMeta, { parentName }) => { - await meowWithSubcommands( - { - create, - view, - }, - { - argv, - description, - importMeta, - name: parentName + ' report', - } - ) - } -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/lib/commands/report/view.js b/vendor/lib/node_modules/@socketsecurity/cli/lib/commands/report/view.js deleted file mode 100644 index 27d33b2..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/lib/commands/report/view.js +++ /dev/null @@ -1,181 +0,0 @@ -/* eslint-disable no-console */ - -import chalk from 'chalk' -import meow from 'meow' -import ora from 'ora' - -import { handleApiCall, handleUnsuccessfulApiResponse } from '../../utils/api-helpers.js' -import { ChalkOrMarkdown } from '../../utils/chalk-markdown.js' -import { InputError } from '../../utils/errors.js' -import { getSeverityCount, formatSeverityCount } from '../../utils/format-issues.js' -import { printFlagList } from '../../utils/formatting.js' -import { objectSome } from '../../utils/misc.js' -import { setupSdk } from '../../utils/sdk.js' - -/** @type {import('../../utils/meow-with-subcommands').CliSubcommand} */ -export const view = { - description: 'View a project report', - async run (argv, importMeta, { parentName }) { - const name = parentName + ' view' - - const input = setupCommand(name, view.description, argv, importMeta) - const result = input && await fetchReportData(input.reportId, input) - - if (result) { - formatReportDataOutput(result, { name, ...input }) - } - } -} - -// Internal functions - -// TODO: Share more of the flag setup inbetween the commands -/** - * @typedef CommandContext - * @property {boolean} includeAllIssues - * @property {boolean} outputJson - * @property {boolean} outputMarkdown - * @property {string} reportId - * @property {boolean} strict - */ - -/** - * @param {string} name - * @param {string} description - * @param {readonly string[]} argv - * @param {ImportMeta} importMeta - * @returns {void|CommandContext} - */ -function setupCommand (name, description, argv, importMeta) { - const cli = meow(` - Usage - $ ${name} - - Options - ${printFlagList({ - '--all': 'Include all issues', - '--json': 'Output result as json', - '--markdown': 'Output result as markdown', - '--strict': 'Exits with an error code if any matching issues are found', - }, 6)} - - Examples - $ ${name} QXU8PmK7LfH608RAwfIKdbcHgwEd_ZeWJ9QEGv05FJUQ - `, { - argv, - description, - importMeta, - flags: { - all: { - type: 'boolean', - default: false, - }, - json: { - type: 'boolean', - alias: 'j', - default: false, - }, - markdown: { - type: 'boolean', - alias: 'm', - default: false, - }, - strict: { - type: 'boolean', - default: false, - }, - } - }) - - // Extract the input - - const { - all: includeAllIssues, - json: outputJson, - markdown: outputMarkdown, - strict, - } = cli.flags - - const [reportId, ...extraInput] = cli.input - - if (!reportId) { - cli.showHelp() - return - } - - // Validate the input - - if (extraInput.length) { - throw new InputError(`Can only handle a single report ID at a time, but got ${cli.input.length} report ID:s: ${cli.input.join(', ')}`) - } - - return { - includeAllIssues, - outputJson, - outputMarkdown, - reportId, - strict, - } -} - -/** - * @typedef ReportData - * @property {import('@socketsecurity/sdk').SocketSdkReturnType<'getReport'>["data"]} data - * @property {Record} severityCount - */ - -/** - * @param {string} reportId - * @param {Pick} context - * @returns {Promise} - */ -export async function fetchReportData (reportId, { includeAllIssues, strict }) { - // Do the API call - - const socketSdk = await setupSdk() - const spinner = ora(`Fetching report with ID ${reportId}`).start() - const result = await handleApiCall(socketSdk.getReport(reportId), spinner, 'fetching report') - - if (result.success === false) { - return handleUnsuccessfulApiResponse(result, spinner) - } - - // Conclude the status of the API call - - const severityCount = getSeverityCount(result.data.issues, includeAllIssues ? undefined : 'high') - - if (objectSome(severityCount)) { - const issueSummary = formatSeverityCount(severityCount) - spinner[strict ? 'fail' : 'succeed'](`Report has these issues: ${issueSummary}`) - } else { - spinner.succeed('Report has no issues') - } - - return { - data: result.data, - severityCount, - } -} - -/** - * @param {ReportData} reportData - * @param {{ name: string } & CommandContext} context - * @returns {void} - */ -export function formatReportDataOutput ({ data, severityCount }, { name, outputJson, outputMarkdown, reportId, strict }) { - if (outputJson) { - console.log(JSON.stringify(data, undefined, 2)) - } else { - const format = new ChalkOrMarkdown(!!outputMarkdown) - const url = `https://socket.dev/npm/reports/${encodeURIComponent(reportId)}` - - console.log('\nDetailed info on socket.dev: ' + format.hyperlink(reportId, url, { fallbackToUrl: true })) - if (!outputMarkdown) { - console.log(chalk.dim('\nOr rerun', chalk.italic(name), 'using the', chalk.italic('--json'), 'flag to get full JSON output')) - } - } - - if (strict && objectSome(severityCount)) { - process.exit(1) - } -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/api-helpers.js b/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/api-helpers.js deleted file mode 100644 index 20b724b..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/api-helpers.js +++ /dev/null @@ -1,43 +0,0 @@ -import chalk from 'chalk' -import { ErrorWithCause } from 'pony-cause' - -import { AuthError } from './errors.js' - -/** - * @template T - * @param {import('@socketsecurity/sdk').SocketSdkErrorType} result - * @param {import('ora').Ora} spinner - * @returns {void} - */ -export function handleUnsuccessfulApiResponse (result, spinner) { - const resultError = 'error' in result && result.error && typeof result.error === 'object' ? result.error : {} - const message = 'message' in resultError && typeof resultError.message === 'string' ? resultError.message : 'No error message returned' - - if (result.status === 401 || result.status === 403) { - spinner.stop() - throw new AuthError(message) - } - spinner.fail(chalk.white.bgRed('API returned an error:') + ' ' + message) - process.exit(1) -} - -/** - * @template T - * @param {Promise} value - * @param {import('ora').Ora} spinner - * @param {string} description - * @returns {Promise} - */ -export async function handleApiCall (value, spinner, description) { - /** @type {T} */ - let result - - try { - result = await value - } catch (cause) { - spinner.fail() - throw new ErrorWithCause(`Failed ${description}`, { cause }) - } - - return result -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/chalk-markdown.js b/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/chalk-markdown.js deleted file mode 100644 index 3dbd7fa..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/chalk-markdown.js +++ /dev/null @@ -1,125 +0,0 @@ -import chalk from 'chalk' -import isUnicodeSupported from 'is-unicode-supported' -import terminalLink from 'terminal-link' - -// From the 'log-symbols' module -const unicodeLogSymbols = { - info: chalk.blue('ℹ'), - success: chalk.green('✔'), - warning: chalk.yellow('⚠'), - error: chalk.red('✖'), -} - -// From the 'log-symbols' module -const fallbackLogSymbols = { - info: chalk.blue('i'), - success: chalk.green('√'), - warning: chalk.yellow('‼'), - error: chalk.red('×'), -} - -// From the 'log-symbols' module -export const logSymbols = isUnicodeSupported() ? unicodeLogSymbols : fallbackLogSymbols - -const markdownLogSymbols = { - info: ':information_source:', - error: ':stop_sign:', - success: ':white_check_mark:', - warning: ':warning:', -} - -export class ChalkOrMarkdown { - /** @type {boolean} */ - useMarkdown - - /** - * @param {boolean} useMarkdown - */ - constructor (useMarkdown) { - this.useMarkdown = !!useMarkdown - } - - /** - * @param {string} text - * @param {number} [level] - * @returns {string} - */ - header (text, level = 1) { - return this.useMarkdown - ? `\n${''.padStart(level, '#')} ${text}\n` - : chalk.underline(`\n${level === 1 ? chalk.bold(text) : text}\n`) - } - - /** - * @param {string} text - * @returns {string} - */ - bold (text) { - return this.useMarkdown - ? `**${text}**` - : chalk.bold(`${text}`) - } - - /** - * @param {string} text - * @returns {string} - */ - italic (text) { - return this.useMarkdown - ? `_${text}_` - : chalk.italic(`${text}`) - } - - /** - * @param {string} text - * @param {string|undefined} url - * @param {{ fallback?: boolean, fallbackToUrl?: boolean }} options - * @returns {string} - */ - hyperlink (text, url, { fallback = true, fallbackToUrl } = {}) { - if (!url) return text - return this.useMarkdown - ? `[${text}](${url})` - : terminalLink(text, url, { - fallback: fallbackToUrl ? (_text, url) => url : fallback - }) - } - - /** - * @param {string[]} items - * @returns {string} - */ - list (items) { - const indentedContent = items.map(item => this.indent(item).trimStart()) - return this.useMarkdown - ? '* ' + indentedContent.join('\n* ') + '\n' - : indentedContent.join('\n') + '\n' - } - - /** - * @returns {typeof logSymbols} - */ - get logSymbols () { - return this.useMarkdown ? markdownLogSymbols : logSymbols - } - - /** - * @param {string} text - * @param {number} [level] - * @returns {string} - */ - indent (text, level = 1) { - const indent = ''.padStart(level * 2, ' ') - return indent + text.split('\n').join('\n' + indent) - } - - /** - * @param {unknown} value - * @returns {string} - */ - json (value) { - return this.useMarkdown - ? '```json\n' + JSON.stringify(value) + '\n```' - : JSON.stringify(value) - } -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/errors.js b/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/errors.js deleted file mode 100644 index 31972e8..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/errors.js +++ /dev/null @@ -1,14 +0,0 @@ -export class AuthError extends Error {} - -export class InputError extends Error { - /** - * @param {string} message - * @param {string} [body] - */ - constructor (message, body) { - super(message) - - /** @type {string|undefined} */ - this.body = body - } -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/format-issues.js b/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/format-issues.js deleted file mode 100644 index bf4a1b7..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/format-issues.js +++ /dev/null @@ -1,72 +0,0 @@ -/** @typedef {import('@socketsecurity/sdk').SocketSdkReturnType<'getIssuesByNPMPackage'>['data']} SocketIssueList */ -/** @typedef {SocketIssueList[number]['value'] extends infer U | undefined ? U : never} SocketIssue */ - -import { pick, stringJoinWithSeparateFinalSeparator } from './misc.js' - -const SEVERITIES_BY_ORDER = /** @type {const} */ ([ - 'critical', - 'high', - 'middle', - 'low', -]) - -/** - * @param {SocketIssue['severity']|undefined} lowestToInclude - * @returns {Array} - */ - function getDesiredSeverities (lowestToInclude) { - /** @type {Array} */ - const result = [] - - for (const severity of SEVERITIES_BY_ORDER) { - result.push(severity) - if (severity === lowestToInclude) { - break - } - } - - return result -} - -/** - * @param {SocketIssueList} issues - * @param {SocketIssue['severity']} [lowestToInclude] - * @returns {Record} - */ -export function getSeverityCount (issues, lowestToInclude) { - const severityCount = pick( - { low: 0, middle: 0, high: 0, critical: 0 }, - getDesiredSeverities(lowestToInclude) - ) - - for (const issue of issues) { - const value = issue.value - - if (!value) { - continue - } - - if (severityCount[value.severity] !== undefined) { - severityCount[value.severity] += 1 - } - } - - return severityCount -} - -/** - * @param {Record} severityCount - * @returns {string} - */ -export function formatSeverityCount (severityCount) { - /** @type {string[]} */ - const summary = [] - - for (const severity of SEVERITIES_BY_ORDER) { - if (severityCount[severity]) { - summary.push(`${severityCount[severity]} ${severity}`) - } - } - - return stringJoinWithSeparateFinalSeparator(summary) -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/formatting.js b/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/formatting.js deleted file mode 100644 index 438791b..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/formatting.js +++ /dev/null @@ -1,36 +0,0 @@ -/** @typedef {string|{ description: string }} ListDescription */ - -/** - * @param {Record} list - * @param {number} indent - * @param {number} padName - * @returns {string} - */ -export function printHelpList (list, indent, padName = 18) { - const names = Object.keys(list).sort() - - let result = '' - - for (const name of names) { - const rawDescription = list[name] - const description = (typeof rawDescription === 'object' ? rawDescription.description : rawDescription) || '' - - result += ''.padEnd(indent) + name.padEnd(padName) + description + '\n' - } - - return result.trim() -} - -/** - * @param {Record} list - * @param {number} indent - * @param {number} padName - * @returns {string} - */ - export function printFlagList (list, indent, padName = 18) { - return printHelpList({ - '--help': 'Print this help and exits.', - '--version': 'Prints current version and exits.', - ...list, - }, indent, padName) -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/meow-with-subcommands.js b/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/meow-with-subcommands.js deleted file mode 100644 index 3858d14..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/meow-with-subcommands.js +++ /dev/null @@ -1,69 +0,0 @@ -import meow from 'meow' - -import { printFlagList, printHelpList } from './formatting.js' -import { ensureIsKeyOf } from './type-helpers.js' - -/** - * @callback CliSubcommandRun - * @param {readonly string[]} argv - * @param {ImportMeta} importMeta - * @param {{ parentName: string }} context - * @returns {Promise|void} - */ - -/** - * @typedef CliSubcommand - * @property {string} description - * @property {CliSubcommandRun} run - */ - -/** - * @template {import('meow').AnyFlags} Flags - * @param {Record} subcommands - * @param {import('meow').Options & { argv: readonly string[], name: string }} options - * @returns {Promise} - */ -export async function meowWithSubcommands (subcommands, options) { - const { - argv, - name, - importMeta, - ...additionalOptions - } = options - const [rawCommandName, ...commandArgv] = argv - - const commandName = ensureIsKeyOf(subcommands, rawCommandName) - const command = commandName ? subcommands[commandName] : undefined - - // If a valid command has been specified, run it... - if (command) { - return await command.run( - commandArgv, - importMeta, - { - parentName: name - } - ) - } - - // ...else provide basic instructions and help - const cli = meow(` - Usage - $ ${name} - - Commands - ${printHelpList(subcommands, 6)} - - Options - ${printFlagList({}, 6)} - - Examples - $ ${name} --help - `, { - argv, - importMeta, - ...additionalOptions, - }) - - cli.showHelp() -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/misc.js b/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/misc.js deleted file mode 100644 index d6a6cb0..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/misc.js +++ /dev/null @@ -1,62 +0,0 @@ -import { logSymbols } from './chalk-markdown.js' - -/** - * @param {boolean|undefined} printDebugLogs - * @returns {typeof console.error} - */ -export function createDebugLogger (printDebugLogs) { - return printDebugLogs - // eslint-disable-next-line no-console - ? (...params) => console.error(logSymbols.info, ...params) - : () => {} -} - -/** - * @param {(string|undefined)[]} list - * @param {string} separator - * @returns {string} - */ -export function stringJoinWithSeparateFinalSeparator (list, separator = ' and ') { - const values = list.filter(value => !!value) - - if (values.length < 2) { - return values[0] || '' - } - - const finalValue = values.pop() - - return values.join(', ') + separator + finalValue -} - -/** - * Returns a new object with only the specified keys from the input object - * - * @template {Record} T - * @template {keyof T} K - * @param {T} input - * @param {K[]|ReadonlyArray} keys - * @returns {Pick} - */ -export function pick (input, keys) { - /** @type {Partial>} */ - const result = {} - - for (const key of keys) { - result[key] = input[key] - } - - return /** @type {Pick} */ (result) -} - -/** - * @param {Record} obj - * @returns {boolean} - */ -export function objectSome (obj) { - for (const key in obj) { - if (obj[key]) { - return true - } - } - return false -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/path-resolve.js b/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/path-resolve.js deleted file mode 100644 index cd6d019..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/path-resolve.js +++ /dev/null @@ -1,152 +0,0 @@ -import { stat } from 'node:fs/promises' -import path from 'node:path' - -import { globby } from 'globby' -import ignore from 'ignore' -// @ts-ignore This package provides no types -import { directories } from 'ignore-by-default' -import { ErrorWithCause } from 'pony-cause' - -import { InputError } from './errors.js' -import { isErrnoException } from './type-helpers.js' - -/** @type {readonly string[]} */ -const SUPPORTED_LOCKFILES = [ - 'package-lock.json', - 'yarn.lock', -] - -/** - * There are a lot of possible folders that we should not be looking in and "ignore-by-default" helps us with defining those - * - * @type {readonly string[]} - */ -const ignoreByDefault = directories() - -/** @type {readonly string[]} */ -const GLOB_IGNORE = [ - ...ignoreByDefault.map(item => '**/' + item) -] - -/** - * Resolves package.json and lockfiles from (globbed) input paths, applying relevant ignores - * - * @param {string} cwd The working directory to use when resolving paths - * @param {string[]} inputPaths A list of paths to folders, package.json files and/or recognized lockfiles. Supports globs. - * @param {import('@socketsecurity/config').SocketYml|undefined} config - * @param {typeof console.error} debugLog - * @returns {Promise} - * @throws {InputError} - */ -export async function getPackageFiles (cwd, inputPaths, config, debugLog) { - const entries = await globby(inputPaths, { - absolute: true, - cwd, - expandDirectories: false, - gitignore: true, - ignore: [...GLOB_IGNORE], - markDirectories: true, - onlyFiles: false, - unique: true, - }) - - debugLog(`Globbed resolved ${inputPaths.length} paths to ${entries.length} paths:`, entries) - - const packageFiles = await mapGlobResultToFiles(entries) - - debugLog(`Mapped ${entries.length} entries to ${packageFiles.length} files:`, packageFiles) - - const includedPackageFiles = config?.projectIgnorePaths?.length - ? ignore() - .add(config.projectIgnorePaths) - .filter(packageFiles.map(item => path.relative(cwd, item))) - .map(item => path.resolve(cwd, item)) - : packageFiles - - return includedPackageFiles -} - -/** - * Takes paths to folders, package.json and/or recognized lock files and resolves them to package.json + lockfile pairs (where possible) - * - * @param {string[]} entries - * @returns {Promise} - * @throws {InputError} - */ -export async function mapGlobResultToFiles (entries) { - const packageFiles = await Promise.all(entries.map(mapGlobEntryToFiles)) - - const uniquePackageFiles = [...new Set(packageFiles.flat())] - - return uniquePackageFiles -} - -/** - * Takes a single path to a folder, package.json or a recognized lock file and resolves to a package.json + lockfile pair (where possible) - * - * @param {string} entry - * @returns {Promise} - * @throws {InputError} - */ -export async function mapGlobEntryToFiles (entry) { - /** @type {string|undefined} */ - let pkgFile - /** @type {string|undefined} */ - let lockFile - - if (entry.endsWith('/')) { - // If the match is a folder and that folder contains a package.json file, then include it - const filePath = path.resolve(entry, 'package.json') - pkgFile = await fileExists(filePath) ? filePath : undefined - } else if (path.basename(entry) === 'package.json') { - // If the match is a package.json file, then include it - pkgFile = entry - } else if (SUPPORTED_LOCKFILES.includes(path.basename(entry))) { - // If the match is a lock file, include both it and the corresponding package.json file - lockFile = entry - pkgFile = path.resolve(path.dirname(entry), 'package.json') - } - - // If we will include a package.json file but don't already have a corresponding lockfile, then look for one - if (!lockFile && pkgFile) { - const pkgDir = path.dirname(pkgFile) - - for (const name of SUPPORTED_LOCKFILES) { - const lockFileAlternative = path.resolve(pkgDir, name) - if (await fileExists(lockFileAlternative)) { - lockFile = lockFileAlternative - break - } - } - } - - if (pkgFile && lockFile) { - return [pkgFile, lockFile] - } - - return pkgFile ? [pkgFile] : [] -} - -/** - * @param {string} filePath - * @returns {Promise} - */ -export async function fileExists (filePath) { - /** @type {import('node:fs').Stats} */ - let pathStat - - try { - pathStat = await stat(filePath) - } catch (err) { - if (isErrnoException(err) && err.code === 'ENOENT') { - return false - } - throw new ErrorWithCause('Error while checking if file exists', { cause: err }) - } - - if (!pathStat.isFile()) { - throw new InputError(`Expected '${filePath}' to be a file`) - } - - return true -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/sdk.js b/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/sdk.js deleted file mode 100644 index be2adf7..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/sdk.js +++ /dev/null @@ -1,45 +0,0 @@ -import { SocketSdk } from '@socketsecurity/sdk' -import isInteractive from 'is-interactive' -import prompts from 'prompts' - -import { AuthError } from './errors.js' - -/** - * @returns {Promise} - */ -export async function setupSdk () { - let apiKey = process.env['SOCKET_SECURITY_API_KEY'] - - if (!apiKey && isInteractive()) { - const input = await prompts({ - type: 'password', - name: 'apiKey', - message: 'Enter your Socket.dev API key', - }) - - apiKey = input.apiKey - } - - if (!apiKey) { - throw new AuthError('You need to provide an API key') - } - - /** @type {import('@socketsecurity/sdk').SocketSdkOptions["agent"]} */ - let agent - - if (process.env['SOCKET_SECURITY_API_PROXY']) { - const { HttpProxyAgent, HttpsProxyAgent } = await import('hpagent') - agent = { - http: new HttpProxyAgent({ proxy: process.env['SOCKET_SECURITY_API_PROXY'] }), - https: new HttpsProxyAgent({ proxy: process.env['SOCKET_SECURITY_API_PROXY'] }), - } - } - - /** @type {import('@socketsecurity/sdk').SocketSdkOptions} */ - const sdkOptions = { - agent, - baseUrl: process.env['SOCKET_SECURITY_API_BASE_URL'], - } - - return new SocketSdk(apiKey || '', sdkOptions) -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/type-helpers.js b/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/type-helpers.js deleted file mode 100644 index 1e30fe7..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/type-helpers.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @template T - * @param {T} obj - * @param {string|undefined} key - * @returns {(keyof T) | undefined} - */ -export function ensureIsKeyOf (obj, key) { - return /** @type {keyof T} */ (key && Object.prototype.hasOwnProperty.call(obj, key) ? key : undefined) -} - -/** - * @param {unknown} value - * @returns {value is NodeJS.ErrnoException} - */ -export function isErrnoException (value) { - if (!(value instanceof Error)) { - return false - } - - const errnoException = /** @type NodeJS.ErrnoException} */ (value) - - return errnoException.code !== undefined -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/update-notifier.js b/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/update-notifier.js deleted file mode 100644 index 1780666..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/lib/utils/update-notifier.js +++ /dev/null @@ -1,15 +0,0 @@ -import { readFile } from 'node:fs/promises' - -import updateNotifier from 'update-notifier' - -/** @returns {void} */ -export function initUpdateNotifier () { - readFile(new URL('../../package.json', import.meta.url), 'utf8') - .then(rawPkg => { - const pkg = JSON.parse(rawPkg) - updateNotifier({ pkg }).notify() - }) - .catch(() => { - // Fail silently if package.json could not be read or parsed - }) -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/.bin/is-ci b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/.bin/is-ci deleted file mode 120000 index fe6aca6..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/.bin/is-ci +++ /dev/null @@ -1 +0,0 @@ -../is-ci/bin.js \ No newline at end of file diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/.bin/rc b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/.bin/rc deleted file mode 120000 index 48b3cda..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/.bin/rc +++ /dev/null @@ -1 +0,0 @@ -../rc/cli.js \ No newline at end of file diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/.bin/semver b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/.bin/semver deleted file mode 120000 index 5aaadf4..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/.bin/semver +++ /dev/null @@ -1 +0,0 @@ -../semver/bin/semver.js \ No newline at end of file diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/LICENSE b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/LICENSE deleted file mode 100644 index 8cfa032..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Apideck - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/README.md b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/README.md deleted file mode 100644 index 45b91b2..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/README.md +++ /dev/null @@ -1,71 +0,0 @@ -[![npm (scoped)](https://img.shields.io/npm/v/@apideck/better-ajv-errors?color=brightgreen)](https://npmjs.com/@apideck/better-ajv-errors) [![npm](https://img.shields.io/npm/dm/@apideck/better-ajv-errors)](https://npmjs.com/@apideck/better-ajv-errors) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/apideck-libraries/better-ajv-errors/CI)](https://github.com/apideck-libraries/better-ajv-errors/actions/workflows/main.yml?query=branch%3Amain++) - -# @apideck/better-ajv-errors 👮‍♀️ - -> Human-friendly JSON Schema validation for APIs - - -- Readable and helpful [ajv](https://github.com/ajv-validator/ajv) errors -- API-friendly format -- Suggestions for spelling mistakes -- Minimal footprint: 1.56 kB (gzip + minified) - -![better-ajv-errors output Example](https://user-images.githubusercontent.com/8850410/118274790-e0529e80-b4c5-11eb-8188-9097c8064c61.png) - -## Install - -```bash -$ yarn add @apideck/better-ajv-errors -``` - -or - -```bash -$ npm i @apideck/better-ajv-errors -``` - -Also make sure that you've installed [ajv](https://www.npmjs.com/package/ajv) at version 8 or higher. - -## Usage - -After validating some data with ajv, pass the errors to `betterAjvErrors` - -```ts -import Ajv from 'ajv'; -import { betterAjvErrors } from '@apideck/better-ajv-errors'; - -// Without allErrors: true, ajv will only return the first error -const ajv = new Ajv({ allErrors: true }); - -const valid = ajv.validate(schema, data); - -if (!valid) { - const betterErrors = betterAjvErrors({ schema, data, errors: ajv.errors }); -} -``` - -## API - -### betterAjvErrors - -Function that formats ajv validation errors in a human-friendly format. - -#### Parameters - -- `options: BetterAjvErrorsOptions` - - `errors: ErrorObject[] | null | undefined` Your ajv errors, you will find these in the `errors` property of your ajv instance (`ErrorObject` is a type from the ajv package). - - `data: Object` The data you passed to ajv to be validated. - - `schema: JSONSchema` The schema you passed to ajv to validate against. - - `basePath?: string` An optional base path to prefix paths returned by `betterAjvErrors`. For example, in APIs, it could be useful to use `'{requestBody}'` or `'{queryParemeters}'` as a basePath. This will make it clear to users where exactly the error occurred. - -#### Return Value - -- `ValidationError[]` Array of formatted errors (properties of `ValidationError` below) - - `message: string` Formatted error message - - `suggestion?: string` Optional suggestion based on provided data and schema - - `path: string` Object path where the error occurred (example: `.foo.bar.0.quz`) - - `context: { errorType: DefinedError['keyword']; [additionalContext: string]: unknown }` `errorType` is `error.keyword` proxied from `ajv`. `errorType` can be used as a key for i18n if needed. There might be additional properties on context, based on the type of error. - -## Related - -- [atlassian/better-ajv-errors](https://github.com/atlassian/better-ajv-errors) was the inspiration for this library. Atlassian's library is more focused on CLI errors, this library is focused on developer-friendly API error messages. diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/better-ajv-errors.cjs.development.js b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/better-ajv-errors.cjs.development.js deleted file mode 100644 index f993a33..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/better-ajv-errors.cjs.development.js +++ /dev/null @@ -1,246 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var leven = _interopDefault(require('leven')); -var pointer = _interopDefault(require('jsonpointer')); - -function _extends() { - _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - - return _extends.apply(this, arguments); -} - -var AJV_ERROR_KEYWORD_WEIGHT_MAP = { - "enum": 1, - type: 0 -}; -var QUOTES_REGEX = /"/g; -var NOT_REGEX = /NOT/g; -var SLASH_REGEX = /\//g; - -var filterSingleErrorPerProperty = function filterSingleErrorPerProperty(errors) { - var errorsPerProperty = errors.reduce(function (acc, error) { - var _ref, _error$params$additio, _error$params, _error$params2, _AJV_ERROR_KEYWORD_WE, _AJV_ERROR_KEYWORD_WE2; - - var prop = error.instancePath + ((_ref = (_error$params$additio = (_error$params = error.params) == null ? void 0 : _error$params.additionalProperty) != null ? _error$params$additio : (_error$params2 = error.params) == null ? void 0 : _error$params2.missingProperty) != null ? _ref : ''); - var existingError = acc[prop]; - - if (!existingError) { - acc[prop] = error; - return acc; - } - - var weight = (_AJV_ERROR_KEYWORD_WE = AJV_ERROR_KEYWORD_WEIGHT_MAP[error.keyword]) != null ? _AJV_ERROR_KEYWORD_WE : 0; - var existingWeight = (_AJV_ERROR_KEYWORD_WE2 = AJV_ERROR_KEYWORD_WEIGHT_MAP[existingError.keyword]) != null ? _AJV_ERROR_KEYWORD_WE2 : 0; - - if (weight > existingWeight) { - acc[prop] = error; - } - - return acc; - }, {}); - return Object.values(errorsPerProperty); -}; - -var getSuggestion = function getSuggestion(_ref) { - var value = _ref.value, - suggestions = _ref.suggestions, - _ref$format = _ref.format, - format = _ref$format === void 0 ? function (suggestion) { - return "Did you mean '" + suggestion + "'?"; - } : _ref$format; - if (!value) return ''; - var bestSuggestion = suggestions.reduce(function (best, current) { - var distance = leven(value, current); - - if (best.distance > distance) { - return { - value: current, - distance: distance - }; - } - - return best; - }, { - distance: Infinity, - value: '' - }); - return bestSuggestion.distance < value.length ? format(bestSuggestion.value) : ''; -}; - -var pointerToDotNotation = function pointerToDotNotation(pointer) { - return pointer.replace(SLASH_REGEX, '.'); -}; -var cleanAjvMessage = function cleanAjvMessage(message) { - return message.replace(QUOTES_REGEX, "'").replace(NOT_REGEX, 'not'); -}; -var getLastSegment = function getLastSegment(path) { - var segments = path.split('/'); - return segments.pop(); -}; -var safeJsonPointer = function safeJsonPointer(_ref) { - var object = _ref.object, - pnter = _ref.pnter, - fallback = _ref.fallback; - - try { - return pointer.get(object, pnter); - } catch (err) { - return fallback; - } -}; - -var betterAjvErrors = function betterAjvErrors(_ref) { - var errors = _ref.errors, - data = _ref.data, - schema = _ref.schema, - _ref$basePath = _ref.basePath, - basePath = _ref$basePath === void 0 ? '{base}' : _ref$basePath; - - if (!Array.isArray(errors) || errors.length === 0) { - return []; - } - - var definedErrors = filterSingleErrorPerProperty(errors); - return definedErrors.map(function (error) { - var path = pointerToDotNotation(basePath + error.instancePath); - var prop = getLastSegment(error.instancePath); - var defaultContext = { - errorType: error.keyword - }; - var defaultMessage = (prop ? "property '" + prop + "'" : path) + " " + cleanAjvMessage(error.message); - var validationError; - - switch (error.keyword) { - case 'additionalProperties': - { - var additionalProp = error.params.additionalProperty; - var suggestionPointer = error.schemaPath.replace('#', '').replace('/additionalProperties', ''); - - var _safeJsonPointer = safeJsonPointer({ - object: schema, - pnter: suggestionPointer, - fallback: { - properties: {} - } - }), - properties = _safeJsonPointer.properties; - - validationError = { - message: "'" + additionalProp + "' property is not expected to be here", - suggestion: getSuggestion({ - value: additionalProp, - suggestions: Object.keys(properties != null ? properties : {}), - format: function format(suggestion) { - return "Did you mean property '" + suggestion + "'?"; - } - }), - path: path, - context: defaultContext - }; - break; - } - - case 'enum': - { - var suggestions = error.params.allowedValues.map(function (value) { - return value.toString(); - }); - - var _prop = getLastSegment(error.instancePath); - - var value = safeJsonPointer({ - object: data, - pnter: error.instancePath, - fallback: '' - }); - validationError = { - message: "'" + _prop + "' property must be equal to one of the allowed values", - suggestion: getSuggestion({ - value: value, - suggestions: suggestions - }), - path: path, - context: _extends({}, defaultContext, { - allowedValues: error.params.allowedValues - }) - }; - break; - } - - case 'type': - { - var _prop2 = getLastSegment(error.instancePath); - - var type = error.params.type; - validationError = { - message: "'" + _prop2 + "' property type must be " + type, - path: path, - context: defaultContext - }; - break; - } - - case 'required': - { - validationError = { - message: path + " must have required property '" + error.params.missingProperty + "'", - path: path, - context: defaultContext - }; - break; - } - - case 'const': - { - return { - message: "'" + prop + "' property must be equal to the allowed value", - path: path, - context: _extends({}, defaultContext, { - allowedValue: error.params.allowedValue - }) - }; - } - - default: - return { - message: defaultMessage, - path: path, - context: defaultContext - }; - } // Remove empty properties - - - var errorEntries = Object.entries(validationError); - - for (var _i = 0, _errorEntries = errorEntries; _i < _errorEntries.length; _i++) { - var _errorEntries$_i = _errorEntries[_i], - key = _errorEntries$_i[0], - _value = _errorEntries$_i[1]; - - if (_value === null || _value === undefined || _value === '') { - delete validationError[key]; - } - } - - return validationError; - }); -}; - -exports.betterAjvErrors = betterAjvErrors; -//# sourceMappingURL=better-ajv-errors.cjs.development.js.map diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/better-ajv-errors.cjs.development.js.map b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/better-ajv-errors.cjs.development.js.map deleted file mode 100644 index 1a88242..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/better-ajv-errors.cjs.development.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"better-ajv-errors.cjs.development.js","sources":["../src/constants.ts","../src/lib/filter.ts","../src/lib/suggestions.ts","../src/lib/utils.ts","../src/index.ts"],"sourcesContent":["import { DefinedError } from 'ajv';\n\nexport const AJV_ERROR_KEYWORD_WEIGHT_MAP: Partial> = {\n enum: 1,\n type: 0,\n};\n\nexport const QUOTES_REGEX = /\"/g;\nexport const NOT_REGEX = /NOT/g;\nexport const SLASH_REGEX = /\\//g;\n","import { DefinedError } from 'ajv';\nimport { AJV_ERROR_KEYWORD_WEIGHT_MAP } from '../constants';\n\nexport const filterSingleErrorPerProperty = (errors: DefinedError[]): DefinedError[] => {\n const errorsPerProperty = errors.reduce>((acc, error) => {\n const prop =\n error.instancePath + ((error.params as any)?.additionalProperty ?? (error.params as any)?.missingProperty ?? '');\n const existingError = acc[prop];\n if (!existingError) {\n acc[prop] = error;\n return acc;\n }\n const weight = AJV_ERROR_KEYWORD_WEIGHT_MAP[error.keyword] ?? 0;\n const existingWeight = AJV_ERROR_KEYWORD_WEIGHT_MAP[existingError.keyword] ?? 0;\n\n if (weight > existingWeight) {\n acc[prop] = error;\n }\n return acc;\n }, {});\n\n return Object.values(errorsPerProperty);\n};\n","import leven from 'leven';\n\nexport const getSuggestion = ({\n value,\n suggestions,\n format = (suggestion) => `Did you mean '${suggestion}'?`,\n}: {\n value: string | null;\n suggestions: string[];\n format?: (suggestion: string) => string;\n}): string => {\n if (!value) return '';\n const bestSuggestion = suggestions.reduce(\n (best, current) => {\n const distance = leven(value, current);\n if (best.distance > distance) {\n return { value: current, distance };\n }\n\n return best;\n },\n {\n distance: Infinity,\n value: '',\n }\n );\n\n return bestSuggestion.distance < value.length ? format(bestSuggestion.value) : '';\n};\n","import { NOT_REGEX, QUOTES_REGEX, SLASH_REGEX } from '../constants';\nimport pointer from 'jsonpointer';\n\nexport const pointerToDotNotation = (pointer: string): string => {\n return pointer.replace(SLASH_REGEX, '.');\n};\n\nexport const cleanAjvMessage = (message: string): string => {\n return message.replace(QUOTES_REGEX, \"'\").replace(NOT_REGEX, 'not');\n};\n\nexport const getLastSegment = (path: string): string => {\n const segments = path.split('/');\n return segments.pop() as string;\n};\n\nexport const safeJsonPointer = ({ object, pnter, fallback }: { object: any; pnter: string; fallback: T }): T => {\n try {\n return pointer.get(object, pnter);\n } catch (err) {\n return fallback;\n }\n};\n","import { DefinedError, ErrorObject } from 'ajv';\nimport type { JSONSchema6 } from 'json-schema';\nimport { ValidationError } from './types/ValidationError';\nimport { filterSingleErrorPerProperty } from './lib/filter';\nimport { getSuggestion } from './lib/suggestions';\nimport { cleanAjvMessage, getLastSegment, pointerToDotNotation, safeJsonPointer } from './lib/utils';\n\nexport interface BetterAjvErrorsOptions {\n errors: ErrorObject[] | null | undefined;\n data: any;\n schema: JSONSchema6;\n basePath?: string;\n}\n\nexport const betterAjvErrors = ({\n errors,\n data,\n schema,\n basePath = '{base}',\n}: BetterAjvErrorsOptions): ValidationError[] => {\n if (!Array.isArray(errors) || errors.length === 0) {\n return [];\n }\n\n const definedErrors = filterSingleErrorPerProperty(errors as DefinedError[]);\n\n return definedErrors.map((error) => {\n const path = pointerToDotNotation(basePath + error.instancePath);\n const prop = getLastSegment(error.instancePath);\n const defaultContext = {\n errorType: error.keyword,\n };\n const defaultMessage = `${prop ? `property '${prop}'` : path} ${cleanAjvMessage(error.message as string)}`;\n\n let validationError: ValidationError;\n\n switch (error.keyword) {\n case 'additionalProperties': {\n const additionalProp = error.params.additionalProperty;\n const suggestionPointer = error.schemaPath.replace('#', '').replace('/additionalProperties', '');\n const { properties } = safeJsonPointer({\n object: schema,\n pnter: suggestionPointer,\n fallback: { properties: {} },\n });\n validationError = {\n message: `'${additionalProp}' property is not expected to be here`,\n suggestion: getSuggestion({\n value: additionalProp,\n suggestions: Object.keys(properties ?? {}),\n format: (suggestion) => `Did you mean property '${suggestion}'?`,\n }),\n path,\n context: defaultContext,\n };\n break;\n }\n case 'enum': {\n const suggestions = error.params.allowedValues.map((value) => value.toString());\n const prop = getLastSegment(error.instancePath);\n const value = safeJsonPointer({ object: data, pnter: error.instancePath, fallback: '' });\n validationError = {\n message: `'${prop}' property must be equal to one of the allowed values`,\n suggestion: getSuggestion({\n value,\n suggestions,\n }),\n path,\n context: {\n ...defaultContext,\n allowedValues: error.params.allowedValues,\n },\n };\n break;\n }\n case 'type': {\n const prop = getLastSegment(error.instancePath);\n const type = error.params.type;\n validationError = {\n message: `'${prop}' property type must be ${type}`,\n path,\n context: defaultContext,\n };\n break;\n }\n case 'required': {\n validationError = {\n message: `${path} must have required property '${error.params.missingProperty}'`,\n path,\n context: defaultContext,\n };\n break;\n }\n case 'const': {\n return {\n message: `'${prop}' property must be equal to the allowed value`,\n path,\n context: {\n ...defaultContext,\n allowedValue: error.params.allowedValue,\n },\n };\n }\n\n default:\n return { message: defaultMessage, path, context: defaultContext };\n }\n\n // Remove empty properties\n const errorEntries = Object.entries(validationError);\n for (const [key, value] of errorEntries as [keyof ValidationError, unknown][]) {\n if (value === null || value === undefined || value === '') {\n delete validationError[key];\n }\n }\n\n return validationError;\n });\n};\n\nexport { ValidationError };\n"],"names":["AJV_ERROR_KEYWORD_WEIGHT_MAP","type","QUOTES_REGEX","NOT_REGEX","SLASH_REGEX","filterSingleErrorPerProperty","errors","errorsPerProperty","reduce","acc","error","prop","instancePath","params","additionalProperty","missingProperty","existingError","weight","keyword","existingWeight","Object","values","getSuggestion","value","suggestions","format","suggestion","bestSuggestion","best","current","distance","leven","Infinity","length","pointerToDotNotation","pointer","replace","cleanAjvMessage","message","getLastSegment","path","segments","split","pop","safeJsonPointer","object","pnter","fallback","get","err","betterAjvErrors","data","schema","basePath","Array","isArray","definedErrors","map","defaultContext","errorType","defaultMessage","validationError","additionalProp","suggestionPointer","schemaPath","properties","keys","context","allowedValues","toString","allowedValue","errorEntries","entries","key","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,IAAMA,4BAA4B,GAAqD;EAC5F,QAAM,CADsF;EAE5FC,IAAI,EAAE;AAFsF,CAAvF;AAKA,IAAMC,YAAY,GAAG,IAArB;AACA,IAAMC,SAAS,GAAG,MAAlB;AACA,IAAMC,WAAW,GAAG,KAApB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AFK;YAGL2B,OAAO,eACFT,cADE;cAELY,YAAY,EAAE5D,KAAK,CAACG,MAAN,CAAayD;;WAL/B;;;MAUF;QACE,OAAO;UAAEhC,OAAO,EAAEsB,cAAX;UAA2BpB,IAAI,EAAJA,IAA3B;UAAiC2B,OAAO,EAAET;SAAjD;;;;IAIJ,IAAMa,YAAY,GAAGnD,MAAM,CAACoD,OAAP,CAAeX,eAAf,CAArB;;IACA,iCAA2BU,YAA3B,mCAA+E;MAA1E;UAAOE,GAAP;UAAYlD,MAAZ;;MACH,IAAIA,MAAK,KAAK,IAAV,IAAkBA,MAAK,KAAKmD,SAA5B,IAAyCnD,MAAK,KAAK,EAAvD,EAA2D;QACzD,OAAOsC,eAAe,CAACY,GAAD,CAAtB;;;;IAIJ,OAAOZ,eAAP;GA1FK,CAAP;AA4FD,CAxGM;;;;"} \ No newline at end of file diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/better-ajv-errors.cjs.production.min.js b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/better-ajv-errors.cjs.production.min.js deleted file mode 100644 index 2429c0f..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/better-ajv-errors.cjs.production.min.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("leven")),r=e(require("jsonpointer"));function a(){return(a=Object.assign||function(e){for(var t=1;tn?{value:a,distance:n}:e}),{distance:Infinity,value:""});return o.distance(null!=(l=n[p.keyword])?l:0)&&(e[i]=t),e):(e[i]=t,e)}),{});return Object.values(t)}(t).map((function(e){var t,n=function(e){return e.replace(u,".")}(v+e.instancePath),d=i(e.instancePath),y={errorType:e.keyword},f=(d?"property '"+d+"'":n)+" "+e.message.replace(o,"'").replace(s,"not");switch(e.keyword){case"additionalProperties":var m=e.params.additionalProperty,g=e.schemaPath.replace("#","").replace("/additionalProperties",""),h=p({object:c,pnter:g,fallback:{properties:{}}}).properties;t={message:"'"+m+"' property is not expected to be here",suggestion:l({value:m,suggestions:Object.keys(null!=h?h:{}),format:function(e){return"Did you mean property '"+e+"'?"}}),path:n,context:y};break;case"enum":var b=e.params.allowedValues.map((function(e){return e.toString()})),P=i(e.instancePath),w=p({object:r,pnter:e.instancePath,fallback:""});t={message:"'"+P+"' property must be equal to one of the allowed values",suggestion:l({value:w,suggestions:b}),path:n,context:a({},y,{allowedValues:e.params.allowedValues})};break;case"type":t={message:"'"+i(e.instancePath)+"' property type must be "+e.params.type,path:n,context:y};break;case"required":t={message:n+" must have required property '"+e.params.missingProperty+"'",path:n,context:y};break;case"const":return{message:"'"+d+"' property must be equal to the allowed value",path:n,context:a({},y,{allowedValue:e.params.allowedValue})};default:return{message:f,path:n,context:y}}for(var j=0,k=Object.entries(t);j> = {\n enum: 1,\n type: 0,\n};\n\nexport const QUOTES_REGEX = /\"/g;\nexport const NOT_REGEX = /NOT/g;\nexport const SLASH_REGEX = /\\//g;\n","import leven from 'leven';\n\nexport const getSuggestion = ({\n value,\n suggestions,\n format = (suggestion) => `Did you mean '${suggestion}'?`,\n}: {\n value: string | null;\n suggestions: string[];\n format?: (suggestion: string) => string;\n}): string => {\n if (!value) return '';\n const bestSuggestion = suggestions.reduce(\n (best, current) => {\n const distance = leven(value, current);\n if (best.distance > distance) {\n return { value: current, distance };\n }\n\n return best;\n },\n {\n distance: Infinity,\n value: '',\n }\n );\n\n return bestSuggestion.distance < value.length ? format(bestSuggestion.value) : '';\n};\n","import { NOT_REGEX, QUOTES_REGEX, SLASH_REGEX } from '../constants';\nimport pointer from 'jsonpointer';\n\nexport const pointerToDotNotation = (pointer: string): string => {\n return pointer.replace(SLASH_REGEX, '.');\n};\n\nexport const cleanAjvMessage = (message: string): string => {\n return message.replace(QUOTES_REGEX, \"'\").replace(NOT_REGEX, 'not');\n};\n\nexport const getLastSegment = (path: string): string => {\n const segments = path.split('/');\n return segments.pop() as string;\n};\n\nexport const safeJsonPointer = ({ object, pnter, fallback }: { object: any; pnter: string; fallback: T }): T => {\n try {\n return pointer.get(object, pnter);\n } catch (err) {\n return fallback;\n }\n};\n","import { DefinedError, ErrorObject } from 'ajv';\nimport type { JSONSchema6 } from 'json-schema';\nimport { ValidationError } from './types/ValidationError';\nimport { filterSingleErrorPerProperty } from './lib/filter';\nimport { getSuggestion } from './lib/suggestions';\nimport { cleanAjvMessage, getLastSegment, pointerToDotNotation, safeJsonPointer } from './lib/utils';\n\nexport interface BetterAjvErrorsOptions {\n errors: ErrorObject[] | null | undefined;\n data: any;\n schema: JSONSchema6;\n basePath?: string;\n}\n\nexport const betterAjvErrors = ({\n errors,\n data,\n schema,\n basePath = '{base}',\n}: BetterAjvErrorsOptions): ValidationError[] => {\n if (!Array.isArray(errors) || errors.length === 0) {\n return [];\n }\n\n const definedErrors = filterSingleErrorPerProperty(errors as DefinedError[]);\n\n return definedErrors.map((error) => {\n const path = pointerToDotNotation(basePath + error.instancePath);\n const prop = getLastSegment(error.instancePath);\n const defaultContext = {\n errorType: error.keyword,\n };\n const defaultMessage = `${prop ? `property '${prop}'` : path} ${cleanAjvMessage(error.message as string)}`;\n\n let validationError: ValidationError;\n\n switch (error.keyword) {\n case 'additionalProperties': {\n const additionalProp = error.params.additionalProperty;\n const suggestionPointer = error.schemaPath.replace('#', '').replace('/additionalProperties', '');\n const { properties } = safeJsonPointer({\n object: schema,\n pnter: suggestionPointer,\n fallback: { properties: {} },\n });\n validationError = {\n message: `'${additionalProp}' property is not expected to be here`,\n suggestion: getSuggestion({\n value: additionalProp,\n suggestions: Object.keys(properties ?? {}),\n format: (suggestion) => `Did you mean property '${suggestion}'?`,\n }),\n path,\n context: defaultContext,\n };\n break;\n }\n case 'enum': {\n const suggestions = error.params.allowedValues.map((value) => value.toString());\n const prop = getLastSegment(error.instancePath);\n const value = safeJsonPointer({ object: data, pnter: error.instancePath, fallback: '' });\n validationError = {\n message: `'${prop}' property must be equal to one of the allowed values`,\n suggestion: getSuggestion({\n value,\n suggestions,\n }),\n path,\n context: {\n ...defaultContext,\n allowedValues: error.params.allowedValues,\n },\n };\n break;\n }\n case 'type': {\n const prop = getLastSegment(error.instancePath);\n const type = error.params.type;\n validationError = {\n message: `'${prop}' property type must be ${type}`,\n path,\n context: defaultContext,\n };\n break;\n }\n case 'required': {\n validationError = {\n message: `${path} must have required property '${error.params.missingProperty}'`,\n path,\n context: defaultContext,\n };\n break;\n }\n case 'const': {\n return {\n message: `'${prop}' property must be equal to the allowed value`,\n path,\n context: {\n ...defaultContext,\n allowedValue: error.params.allowedValue,\n },\n };\n }\n\n default:\n return { message: defaultMessage, path, context: defaultContext };\n }\n\n // Remove empty properties\n const errorEntries = Object.entries(validationError);\n for (const [key, value] of errorEntries as [keyof ValidationError, unknown][]) {\n if (value === null || value === undefined || value === '') {\n delete validationError[key];\n }\n }\n\n return validationError;\n });\n};\n\nexport { ValidationError };\n","import { DefinedError } from 'ajv';\nimport { AJV_ERROR_KEYWORD_WEIGHT_MAP } from '../constants';\n\nexport const filterSingleErrorPerProperty = (errors: DefinedError[]): DefinedError[] => {\n const errorsPerProperty = errors.reduce>((acc, error) => {\n const prop =\n error.instancePath + ((error.params as any)?.additionalProperty ?? (error.params as any)?.missingProperty ?? '');\n const existingError = acc[prop];\n if (!existingError) {\n acc[prop] = error;\n return acc;\n }\n const weight = AJV_ERROR_KEYWORD_WEIGHT_MAP[error.keyword] ?? 0;\n const existingWeight = AJV_ERROR_KEYWORD_WEIGHT_MAP[existingError.keyword] ?? 0;\n\n if (weight > existingWeight) {\n acc[prop] = error;\n }\n return acc;\n }, {});\n\n return Object.values(errorsPerProperty);\n};\n"],"names":["AJV_ERROR_KEYWORD_WEIGHT_MAP","enum","type","QUOTES_REGEX","NOT_REGEX","SLASH_REGEX","getSuggestion","value","format","suggestion","bestSuggestion","suggestions","reduce","best","current","distance","leven","Infinity","length","getLastSegment","path","split","pop","safeJsonPointer","object","pnter","fallback","pointer","get","err","errors","data","schema","basePath","Array","isArray","errorsPerProperty","acc","error","prop","instancePath","params","_error$params","additionalProperty","_error$params2","missingProperty","existingError","keyword","Object","values","filterSingleErrorPerProperty","map","validationError","replace","pointerToDotNotation","defaultContext","errorType","defaultMessage","message","additionalProp","suggestionPointer","schemaPath","properties","keys","context","allowedValues","toString","allowedValue","entries"],"mappings":"+YAEO,IAAMA,EAAiF,CAC5FC,KAAM,EACNC,KAAM,GAGKC,EAAe,KACfC,EAAY,OACZC,EAAc,MCPdC,EAAgB,gBAC3BC,IAAAA,UAEAC,OAAAA,aAAS,SAACC,GAAD,uBAAiCA,UAM1C,IAAKF,EAAO,MAAO,GACnB,IAAMG,IARNC,YAQmCC,QACjC,SAACC,EAAMC,GACL,IAAMC,EAAWC,EAAMT,EAAOO,GAC9B,OAAID,EAAKE,SAAWA,EACX,CAAER,MAAOO,EAASC,SAAAA,GAGpBF,IAET,CACEE,SAAUE,SACVV,MAAO,KAIX,OAAOG,EAAeK,SAAWR,EAAMW,OAASV,EAAOE,EAAeH,OAAS,IChBpEY,EAAiB,SAACC,GAE7B,OADiBA,EAAKC,MAAM,KACZC,OAGLC,EAAkB,gBAAMC,IAAAA,OAAQC,IAAAA,MAAOC,IAAAA,SAClD,IACE,OAAOC,EAAQC,IAAIJ,EAAQC,GAC3B,MAAOI,GACP,OAAOH,4BCNoB,gBAC7BI,IAAAA,OACAC,IAAAA,KACAC,IAAAA,WACAC,SAAAA,aAAW,WAEX,OAAKC,MAAMC,QAAQL,IAA6B,IAAlBA,EAAOZ,OCjBK,SAACY,GAC3C,IAAMM,EAAoBN,EAAOlB,QAAqC,SAACyB,EAAKC,mBACpEC,EACJD,EAAME,yCAAiBF,EAAMG,eAANC,EAAsBC,+BAAuBL,EAAMG,eAANG,EAAsBC,mBAAmB,IACzGC,EAAgBT,EAAIE,GAC1B,OAAKO,aAIU9C,EAA6BsC,EAAMS,YAAY,aACvC/C,EAA6B8C,EAA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EAAMG,OAAOvC,KAGxBkB,KAAAA,EACA4C,QAAST,GAEX,MAEF,IAAK,WACHH,EAAkB,CAChBM,QAAYtC,mCAAqCkB,EAAMG,OAAOI,oBAC9DzB,KAAAA,EACA4C,QAAST,GAEX,MAEF,IAAK,QACH,MAAO,CACLG,YAAanB,kDACbnB,KAAAA,EACA4C,aACKT,GACHY,aAAc7B,EAAMG,OAAO0B,gBAKjC,QACE,MAAO,CAAET,QAASD,EAAgBrC,KAAAA,EAAM4C,QAAST,GAKrD,IADA,UAAqBP,OAAOoB,QAAQhB,kBAC2C,CAA1E,WAAY7C,OACXA,MAAAA,GAAmD,KAAVA,UACpC6C,QAIX,OAAOA,KA/FA"} \ No newline at end of file diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/better-ajv-errors.esm.js b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/better-ajv-errors.esm.js deleted file mode 100644 index 70a43e7..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/better-ajv-errors.esm.js +++ /dev/null @@ -1,240 +0,0 @@ -import leven from 'leven'; -import pointer from 'jsonpointer'; - -function _extends() { - _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - - return _extends.apply(this, arguments); -} - -var AJV_ERROR_KEYWORD_WEIGHT_MAP = { - "enum": 1, - type: 0 -}; -var QUOTES_REGEX = /"/g; -var NOT_REGEX = /NOT/g; -var SLASH_REGEX = /\//g; - -var filterSingleErrorPerProperty = function filterSingleErrorPerProperty(errors) { - var errorsPerProperty = errors.reduce(function (acc, error) { - var _ref, _error$params$additio, _error$params, _error$params2, _AJV_ERROR_KEYWORD_WE, _AJV_ERROR_KEYWORD_WE2; - - var prop = error.instancePath + ((_ref = (_error$params$additio = (_error$params = error.params) == null ? void 0 : _error$params.additionalProperty) != null ? _error$params$additio : (_error$params2 = error.params) == null ? void 0 : _error$params2.missingProperty) != null ? _ref : ''); - var existingError = acc[prop]; - - if (!existingError) { - acc[prop] = error; - return acc; - } - - var weight = (_AJV_ERROR_KEYWORD_WE = AJV_ERROR_KEYWORD_WEIGHT_MAP[error.keyword]) != null ? _AJV_ERROR_KEYWORD_WE : 0; - var existingWeight = (_AJV_ERROR_KEYWORD_WE2 = AJV_ERROR_KEYWORD_WEIGHT_MAP[existingError.keyword]) != null ? _AJV_ERROR_KEYWORD_WE2 : 0; - - if (weight > existingWeight) { - acc[prop] = error; - } - - return acc; - }, {}); - return Object.values(errorsPerProperty); -}; - -var getSuggestion = function getSuggestion(_ref) { - var value = _ref.value, - suggestions = _ref.suggestions, - _ref$format = _ref.format, - format = _ref$format === void 0 ? function (suggestion) { - return "Did you mean '" + suggestion + "'?"; - } : _ref$format; - if (!value) return ''; - var bestSuggestion = suggestions.reduce(function (best, current) { - var distance = leven(value, current); - - if (best.distance > distance) { - return { - value: current, - distance: distance - }; - } - - return best; - }, { - distance: Infinity, - value: '' - }); - return bestSuggestion.distance < value.length ? format(bestSuggestion.value) : ''; -}; - -var pointerToDotNotation = function pointerToDotNotation(pointer) { - return pointer.replace(SLASH_REGEX, '.'); -}; -var cleanAjvMessage = function cleanAjvMessage(message) { - return message.replace(QUOTES_REGEX, "'").replace(NOT_REGEX, 'not'); -}; -var getLastSegment = function getLastSegment(path) { - var segments = path.split('/'); - return segments.pop(); -}; -var safeJsonPointer = function safeJsonPointer(_ref) { - var object = _ref.object, - pnter = _ref.pnter, - fallback = _ref.fallback; - - try { - return pointer.get(object, pnter); - } catch (err) { - return fallback; - } -}; - -var betterAjvErrors = function betterAjvErrors(_ref) { - var errors = _ref.errors, - data = _ref.data, - schema = _ref.schema, - _ref$basePath = _ref.basePath, - basePath = _ref$basePath === void 0 ? '{base}' : _ref$basePath; - - if (!Array.isArray(errors) || errors.length === 0) { - return []; - } - - var definedErrors = filterSingleErrorPerProperty(errors); - return definedErrors.map(function (error) { - var path = pointerToDotNotation(basePath + error.instancePath); - var prop = getLastSegment(error.instancePath); - var defaultContext = { - errorType: error.keyword - }; - var defaultMessage = (prop ? "property '" + prop + "'" : path) + " " + cleanAjvMessage(error.message); - var validationError; - - switch (error.keyword) { - case 'additionalProperties': - { - var additionalProp = error.params.additionalProperty; - var suggestionPointer = error.schemaPath.replace('#', '').replace('/additionalProperties', ''); - - var _safeJsonPointer = safeJsonPointer({ - object: schema, - pnter: suggestionPointer, - fallback: { - properties: {} - } - }), - properties = _safeJsonPointer.properties; - - validationError = { - message: "'" + additionalProp + "' property is not expected to be here", - suggestion: getSuggestion({ - value: additionalProp, - suggestions: Object.keys(properties != null ? properties : {}), - format: function format(suggestion) { - return "Did you mean property '" + suggestion + "'?"; - } - }), - path: path, - context: defaultContext - }; - break; - } - - case 'enum': - { - var suggestions = error.params.allowedValues.map(function (value) { - return value.toString(); - }); - - var _prop = getLastSegment(error.instancePath); - - var value = safeJsonPointer({ - object: data, - pnter: error.instancePath, - fallback: '' - }); - validationError = { - message: "'" + _prop + "' property must be equal to one of the allowed values", - suggestion: getSuggestion({ - value: value, - suggestions: suggestions - }), - path: path, - context: _extends({}, defaultContext, { - allowedValues: error.params.allowedValues - }) - }; - break; - } - - case 'type': - { - var _prop2 = getLastSegment(error.instancePath); - - var type = error.params.type; - validationError = { - message: "'" + _prop2 + "' property type must be " + type, - path: path, - context: defaultContext - }; - break; - } - - case 'required': - { - validationError = { - message: path + " must have required property '" + error.params.missingProperty + "'", - path: path, - context: defaultContext - }; - break; - } - - case 'const': - { - return { - message: "'" + prop + "' property must be equal to the allowed value", - path: path, - context: _extends({}, defaultContext, { - allowedValue: error.params.allowedValue - }) - }; - } - - default: - return { - message: defaultMessage, - path: path, - context: defaultContext - }; - } // Remove empty properties - - - var errorEntries = Object.entries(validationError); - - for (var _i = 0, _errorEntries = errorEntries; _i < _errorEntries.length; _i++) { - var _errorEntries$_i = _errorEntries[_i], - key = _errorEntries$_i[0], - _value = _errorEntries$_i[1]; - - if (_value === null || _value === undefined || _value === '') { - delete validationError[key]; - } - } - - return validationError; - }); -}; - -export { betterAjvErrors }; -//# sourceMappingURL=better-ajv-errors.esm.js.map diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/better-ajv-errors.esm.js.map b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/better-ajv-errors.esm.js.map deleted file mode 100644 index 0acffac..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/better-ajv-errors.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"better-ajv-errors.esm.js","sources":["../src/constants.ts","../src/lib/filter.ts","../src/lib/suggestions.ts","../src/lib/utils.ts","../src/index.ts"],"sourcesContent":["import { DefinedError } from 'ajv';\n\nexport const AJV_ERROR_KEYWORD_WEIGHT_MAP: Partial> = {\n enum: 1,\n type: 0,\n};\n\nexport const QUOTES_REGEX = /\"/g;\nexport const NOT_REGEX = /NOT/g;\nexport const SLASH_REGEX = /\\//g;\n","import { DefinedError } from 'ajv';\nimport { AJV_ERROR_KEYWORD_WEIGHT_MAP } from '../constants';\n\nexport const filterSingleErrorPerProperty = (errors: DefinedError[]): DefinedError[] => {\n const errorsPerProperty = errors.reduce>((acc, error) => {\n const prop =\n error.instancePath + ((error.params as any)?.additionalProperty ?? (error.params as any)?.missingProperty ?? '');\n const existingError = acc[prop];\n if (!existingError) {\n acc[prop] = error;\n return acc;\n }\n const weight = AJV_ERROR_KEYWORD_WEIGHT_MAP[error.keyword] ?? 0;\n const existingWeight = AJV_ERROR_KEYWORD_WEIGHT_MAP[existingError.keyword] ?? 0;\n\n if (weight > existingWeight) {\n acc[prop] = error;\n }\n return acc;\n }, {});\n\n return Object.values(errorsPerProperty);\n};\n","import leven from 'leven';\n\nexport const getSuggestion = ({\n value,\n suggestions,\n format = (suggestion) => `Did you mean '${suggestion}'?`,\n}: {\n value: string | null;\n suggestions: string[];\n format?: (suggestion: string) => string;\n}): string => {\n if (!value) return '';\n const bestSuggestion = suggestions.reduce(\n (best, current) => {\n const distance = leven(value, current);\n if (best.distance > distance) {\n return { value: current, distance };\n }\n\n return best;\n },\n {\n distance: Infinity,\n value: '',\n }\n );\n\n return bestSuggestion.distance < value.length ? format(bestSuggestion.value) : '';\n};\n","import { NOT_REGEX, QUOTES_REGEX, SLASH_REGEX } from '../constants';\nimport pointer from 'jsonpointer';\n\nexport const pointerToDotNotation = (pointer: string): string => {\n return pointer.replace(SLASH_REGEX, '.');\n};\n\nexport const cleanAjvMessage = (message: string): string => {\n return message.replace(QUOTES_REGEX, \"'\").replace(NOT_REGEX, 'not');\n};\n\nexport const getLastSegment = (path: string): string => {\n const segments = path.split('/');\n return segments.pop() as string;\n};\n\nexport const safeJsonPointer = ({ object, pnter, fallback }: { object: any; pnter: string; fallback: T }): T => {\n try {\n return pointer.get(object, pnter);\n } catch (err) {\n return fallback;\n }\n};\n","import { DefinedError, ErrorObject } from 'ajv';\nimport type { JSONSchema6 } from 'json-schema';\nimport { ValidationError } from './types/ValidationError';\nimport { filterSingleErrorPerProperty } from './lib/filter';\nimport { getSuggestion } from './lib/suggestions';\nimport { cleanAjvMessage, getLastSegment, pointerToDotNotation, safeJsonPointer } from './lib/utils';\n\nexport interface BetterAjvErrorsOptions {\n errors: ErrorObject[] | null | undefined;\n data: any;\n schema: JSONSchema6;\n basePath?: string;\n}\n\nexport const betterAjvErrors = ({\n errors,\n data,\n schema,\n basePath = '{base}',\n}: BetterAjvErrorsOptions): ValidationError[] => {\n if (!Array.isArray(errors) || errors.length === 0) {\n return [];\n }\n\n const definedErrors = filterSingleErrorPerProperty(errors as DefinedError[]);\n\n return definedErrors.map((error) => {\n const path = pointerToDotNotation(basePath + error.instancePath);\n const prop = getLastSegment(error.instancePath);\n const defaultContext = {\n errorType: error.keyword,\n };\n const defaultMessage = `${prop ? `property '${prop}'` : path} ${cleanAjvMessage(error.message as string)}`;\n\n let validationError: ValidationError;\n\n switch (error.keyword) {\n case 'additionalProperties': {\n const additionalProp = error.params.additionalProperty;\n const suggestionPointer = error.schemaPath.replace('#', '').replace('/additionalProperties', '');\n const { properties } = safeJsonPointer({\n object: schema,\n pnter: suggestionPointer,\n fallback: { properties: {} },\n });\n validationError = {\n message: `'${additionalProp}' property is not expected to be here`,\n suggestion: getSuggestion({\n value: additionalProp,\n suggestions: Object.keys(properties ?? {}),\n format: (suggestion) => `Did you mean property '${suggestion}'?`,\n }),\n path,\n context: defaultContext,\n };\n break;\n }\n case 'enum': {\n const suggestions = error.params.allowedValues.map((value) => value.toString());\n const prop = getLastSegment(error.instancePath);\n const value = safeJsonPointer({ object: data, pnter: error.instancePath, fallback: '' });\n validationError = {\n message: `'${prop}' property must be equal to one of the allowed values`,\n suggestion: getSuggestion({\n value,\n suggestions,\n }),\n path,\n context: {\n ...defaultContext,\n allowedValues: error.params.allowedValues,\n },\n };\n break;\n }\n case 'type': {\n const prop = getLastSegment(error.instancePath);\n const type = error.params.type;\n validationError = {\n message: `'${prop}' property type must be ${type}`,\n path,\n context: defaultContext,\n };\n break;\n }\n case 'required': {\n validationError = {\n message: `${path} must have required property '${error.params.missingProperty}'`,\n path,\n context: defaultContext,\n };\n break;\n }\n case 'const': {\n return {\n message: `'${prop}' property must be equal to the allowed value`,\n path,\n context: {\n ...defaultContext,\n allowedValue: error.params.allowedValue,\n },\n };\n }\n\n default:\n return { message: defaultMessage, path, context: defaultContext };\n }\n\n // Remove empty properties\n const errorEntries = Object.entries(validationError);\n for (const [key, value] of errorEntries as [keyof ValidationError, unknown][]) {\n if (value === null || value === undefined || value === '') {\n delete validationError[key];\n }\n }\n\n return validationError;\n });\n};\n\nexport { ValidationError };\n"],"names":["AJV_ERROR_KEYWORD_WEIGHT_MAP","type","QUOTES_REGEX","NOT_REGEX","SLASH_REGEX","filterSingleErrorPerProperty","errors","errorsPerProperty","reduce","acc","error","prop","instancePath","params","additionalProperty","missingProperty","existingError","weight","keyword","existingWeight","Object","values","getSuggestion","value","suggestions","format","suggestion","bestSuggestion","best","current","distance","leven","Infinity","length","pointerToDotNotation","pointer","replace","cleanAjvMessage","message","getLastSegment","path","segments","split","pop","safeJsonPointer","object","pnter","fallback","get","err","betterAjvErrors","data","schema","basePath","Array","isArray","definedErrors","map","defaultContext","errorType","defaultMessage","validationError","additionalProp","suggestionPointer","schemaPath","properties","keys","context","allowedValues","toString","allowedValue","errorEntries","entries","key","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEO,IAAMA,4BAA4B,GAAqD;EAC5F,QAAM,CADsF;EAE5FC,IAAI,EAAE;AAFsF,CAAvF;AAKA,IAAMC,YAAY,GAAG,IAArB;AACA,IAAMC,SAAS,GAAG,MAAlB;AACA,IAAMC,WAAW,GAAG,KAApB;;ACNA,IAAMC,4BAA4B,GAAG,SAA/BA,4BAA+B,CAACC,MAAD;EAC1C,IAAMC,iBAAiB,GAAGD,MAAM,CAACE,MAAP,CAA4C,UAACC,GAAD,EAAMC,KAAN;;;IACpE,IAAMC,IAAI,GACRD,KAAK,CAACE,YAAN,sDAAuBF,KAAK,CAACG,MAA7B,qBAAuB,cAAsBC,kBAA7C,sDAAoEJ,KAAK,CAACG,MAA1E,qBAAoE,eAAsBE,eAA1F,mBAA6G,EAA7G,CADF;IAEA,IAAMC,aAAa,GAAGP,GAAG,CAACE,IAAD,CAAzB;;IACA,IAAI,CAACK,aAAL,EAAoB;MAClBP,GAAG,CAACE,IAAD,CAAH,GAAYD,KAAZ;MACA,OAAOD,GAAP;;;IAEF,IAAMQ,MAAM,4BAAGjB,4BAA4B,CAACU,KAAK,CAACQ,OAAP,CAA/B,oCAAkD,CAA9D;IACA,IAAMC,cAAc,6BAAGnB,4BAA4B,CAACgB,aAAa,CAACE,OAAf,CAA/B,qCAA0D,CAA9E;;IAEA,IAAID,MAAM,GAAGE,cAAb,EAA6B;MAC3BV,GA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MAAL;QAAa;UACX,IAAMzD,MAAI,GAAG4B,cAAc,CAAC7B,KAAK,CAACE,YAAP,CAA3B;;UACA,IAAMX,IAAI,GAAGS,KAAK,CAACG,MAAN,CAAaZ,IAA1B;UACA4D,eAAe,GAAG;YAChBvB,OAAO,QAAM3B,MAAN,gCAAqCV,IAD5B;YAEhBuC,IAAI,EAAJA,IAFgB;YAGhB2B,OAAO,EAAET;WAHX;UAKA;;;MAEF,KAAK,UAAL;QAAiB;UACfG,eAAe,GAAG;YAChBvB,OAAO,EAAKE,IAAL,sCAA0C9B,KAAK,CAACG,MAAN,CAAaE,eAAvD,MADS;YAEhByB,IAAI,EAAJA,IAFgB;YAGhB2B,OAAO,EAAET;WAHX;UAKA;;;MAEF,KAAK,OAAL;QAAc;UACZ,OAAO;YACLpB,OAAO,QAAM3B,IAAN,kDADF;YAEL6B,IAAI,EAAJA,IAFK;YAGL2B,OAAO,eACFT,cADE;cAELY,YAAY,EAAE5D,KAAK,CAACG,MAAN,CAAayD;;WAL/B;;;MAUF;QACE,OAAO;UAAEhC,OAAO,EAAEsB,cAAX;UAA2BpB,IAAI,EAAJA,IAA3B;UAAiC2B,OAAO,EAAET;SAAjD;;;;IAIJ,IAAMa,YAAY,GAAGnD,MAAM,CAACoD,OAAP,CAAeX,eAAf,CAArB;;IACA,iCAA2BU,YAA3B,mCAA+E;MAA1E;UAAOE,GAAP;UAAYlD,MAAZ;;MACH,IAAIA,MAAK,KAAK,IAAV,IAAkBA,MAAK,KAAKmD,SAA5B,IAAyCnD,MAAK,KAAK,EAAvD,EAA2D;QACzD,OAAOsC,eAAe,CAACY,GAAD,CAAtB;;;;IAIJ,OAAOZ,eAAP;GA1FK,CAAP;AA4FD,CAxGM;;;;"} \ No newline at end of file diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/constants.d.ts b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/constants.d.ts deleted file mode 100644 index 9319693..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/constants.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { DefinedError } from 'ajv'; -export declare const AJV_ERROR_KEYWORD_WEIGHT_MAP: Partial>; -export declare const QUOTES_REGEX: RegExp; -export declare const NOT_REGEX: RegExp; -export declare const SLASH_REGEX: RegExp; diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/index.d.ts b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/index.d.ts deleted file mode 100644 index 265e8e9..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ErrorObject } from 'ajv'; -import type { JSONSchema6 } from 'json-schema'; -import { ValidationError } from './types/ValidationError'; -export interface BetterAjvErrorsOptions { - errors: ErrorObject[] | null | undefined; - data: any; - schema: JSONSchema6; - basePath?: string; -} -export declare const betterAjvErrors: ({ errors, data, schema, basePath, }: BetterAjvErrorsOptions) => ValidationError[]; -export { ValidationError }; diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/index.js b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/index.js deleted file mode 100644 index 90749be..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/index.js +++ /dev/null @@ -1,8 +0,0 @@ - -'use strict' - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./better-ajv-errors.cjs.production.min.js') -} else { - module.exports = require('./better-ajv-errors.cjs.development.js') -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/lib/filter.d.ts b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/lib/filter.d.ts deleted file mode 100644 index e7191f7..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/lib/filter.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { DefinedError } from 'ajv'; -export declare const filterSingleErrorPerProperty: (errors: DefinedError[]) => DefinedError[]; diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/lib/suggestions.d.ts b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/lib/suggestions.d.ts deleted file mode 100644 index 94f77b6..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/lib/suggestions.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare const getSuggestion: ({ value, suggestions, format, }: { - value: string | null; - suggestions: string[]; - format?: ((suggestion: string) => string) | undefined; -}) => string; diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/lib/utils.d.ts b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/lib/utils.d.ts deleted file mode 100644 index 02a0f08..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/lib/utils.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export declare const pointerToDotNotation: (pointer: string) => string; -export declare const cleanAjvMessage: (message: string) => string; -export declare const getLastSegment: (path: string) => string; -export declare const safeJsonPointer: ({ object, pnter, fallback }: { - object: any; - pnter: string; - fallback: T; -}) => T; diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/types/ValidationError.d.ts b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/types/ValidationError.d.ts deleted file mode 100644 index 65ad6fc..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/dist/types/ValidationError.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { DefinedError } from 'ajv'; -export interface ValidationError { - message: string; - path: string; - suggestion?: string; - context: { - errorType: DefinedError['keyword']; - [additionalContext: string]: unknown; - }; -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/package.json b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/package.json deleted file mode 100644 index d9077ae..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "@apideck/better-ajv-errors", - "description": "Human-friendly JSON Schema validation for APIs", - "version": "0.3.6", - "author": "Apideck (https://apideck.com/)", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/apideck-libraries/better-ajv-errors" - }, - "bugs": { - "url": "https://github.com/apideck-libraries/better-ajv-errors/issues" - }, - "contributors": [ - "Elias Meire " - ], - "main": "dist/index.js", - "module": "dist/better-ajv-errors.esm.js", - "typings": "dist/index.d.ts", - "files": [ - "dist", - "src" - ], - "engines": { - "node": ">=10" - }, - "scripts": { - "start": "tsdx watch", - "build": "tsdx build", - "test": "tsdx test", - "lint": "tsdx lint", - "prepare": "tsdx build", - "size": "size-limit", - "release": "np --no-publish && npm publish --access public --registry https://registry.npmjs.org", - "analyze": "size-limit --why" - }, - "husky": { - "hooks": { - "pre-commit": "tsdx lint" - } - }, - "prettier": { - "printWidth": 120, - "singleQuote": true, - "trailingComma": "es5" - }, - "size-limit": [ - { - "path": "dist/better-ajv-errors.cjs.production.min.js", - "limit": "2 KB" - }, - { - "path": "dist/better-ajv-errors.esm.js", - "limit": "2.5 KB" - } - ], - "devDependencies": { - "@size-limit/preset-small-lib": "^7.0.8", - "ajv": "^8.11.0", - "eslint-plugin-prettier": "^4.0.0", - "husky": "^8.0.1", - "np": "^7.6.1", - "size-limit": "^7.0.8", - "tsdx": "^0.14.1", - "tslib": "^2.4.0", - "typescript": "^4.7.2" - }, - "peerDependencies": { - "ajv": ">=8" - }, - "dependencies": { - "json-schema": "^0.4.0", - "jsonpointer": "^5.0.0", - "leven": "^3.1.0" - }, - "resolutions": { - "prettier": "^2.3.0" - }, - "keywords": [ - "apideck", - "ajv", - "json", - "schema", - "json-schema", - "errors", - "human" - ] -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/constants.ts b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/constants.ts deleted file mode 100644 index 947296b..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/constants.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { DefinedError } from 'ajv'; - -export const AJV_ERROR_KEYWORD_WEIGHT_MAP: Partial> = { - enum: 1, - type: 0, -}; - -export const QUOTES_REGEX = /"/g; -export const NOT_REGEX = /NOT/g; -export const SLASH_REGEX = /\//g; diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/index.test.ts b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/index.test.ts deleted file mode 100644 index c945c51..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/index.test.ts +++ /dev/null @@ -1,434 +0,0 @@ -import Ajv from 'ajv'; -import { JSONSchema6 } from 'json-schema'; -import { betterAjvErrors } from './index'; - -describe('betterAjvErrors', () => { - let ajv: Ajv; - let schema: JSONSchema6; - let data: Record; - - beforeEach(() => { - ajv = new Ajv({ allErrors: true }); - schema = { - type: 'object', - required: ['str'], - properties: { - str: { - type: 'string', - }, - enum: { - type: 'string', - enum: ['one', 'two'], - }, - bounds: { - type: 'number', - minimum: 2, - maximum: 4, - }, - nested: { - type: 'object', - required: ['deepReq'], - properties: { - deepReq: { - type: 'boolean', - }, - deep: { - type: 'string', - }, - }, - additionalProperties: false, - }, - }, - additionalProperties: false, - }; - }); - - describe('additionalProperties', () => { - it('should handle additionalProperties=false', () => { - data = { - str: 'str', - foo: 'bar', - }; - ajv.validate(schema, data); - const errors = betterAjvErrors({ data, schema, errors: ajv.errors }); - expect(errors).toEqual([ - { - context: { - errorType: 'additionalProperties', - }, - message: "'foo' property is not expected to be here", - path: '{base}', - }, - ]); - }); - - it('should handle additionalProperties=true', () => { - data = { - str: 'str', - foo: 'bar', - }; - schema.additionalProperties = true; - ajv.validate(schema, data); - const errors = betterAjvErrors({ data, schema, errors: ajv.errors }); - expect(errors).toEqual([]); - }); - - it('should give suggestions when relevant', () => { - data = { - str: 'str', - bonds: 'bar', - }; - ajv.validate(schema, data); - const errors = betterAjvErrors({ data, schema, errors: ajv.errors }); - expect(errors).toEqual([ - { - context: { - errorType: 'additionalProperties', - }, - message: "'bonds' property is not expected to be here", - path: '{base}', - suggestion: "Did you mean property 'bounds'?", - }, - ]); - }); - - it('should handle object schemas without properties', () => { - data = { - empty: { foo: 1 }, - }; - schema = { - type: 'object', - properties: { - empty: { - type: 'object', - additionalProperties: false, - }, - }, - }; - ajv.validate(schema, data); - const errors = betterAjvErrors({ data, schema, errors: ajv.errors }); - expect(errors).toEqual([ - { - context: { - errorType: 'additionalProperties', - }, - message: "'foo' property is not expected to be here", - path: '{base}.empty', - }, - ]); - }); - }); - - describe('required', () => { - it('should handle required properties', () => { - data = { - nested: {}, - }; - ajv.validate(schema, data); - const errors = betterAjvErrors({ data, schema, errors: ajv.errors }); - expect(errors).toEqual([ - { - context: { - errorType: 'required', - }, - message: "{base} must have required property 'str'", - path: '{base}', - }, - { - context: { - errorType: 'required', - }, - message: "{base}.nested must have required property 'deepReq'", - path: '{base}.nested', - }, - ]); - }); - - it('should handle multiple required properties', () => { - schema = { - type: 'object', - required: ['req1', 'req2'], - properties: { - req1: { - type: 'string', - }, - req2: { - type: 'string', - }, - }, - }; - data = {}; - ajv.validate(schema, data); - const errors = betterAjvErrors({ data, schema, errors: ajv.errors }); - expect(errors).toEqual([ - { - context: { - errorType: 'required', - }, - message: "{base} must have required property 'req1'", - path: '{base}', - }, - { - context: { - errorType: 'required', - }, - message: "{base} must have required property 'req2'", - path: '{base}', - }, - ]); - }); - }); - - describe('type', () => { - it('should handle type errors', () => { - data = { - str: 123, - }; - ajv.validate(schema, data); - const errors = betterAjvErrors({ data, schema, errors: ajv.errors }); - expect(errors).toEqual([ - { - context: { - errorType: 'type', - }, - message: "'str' property type must be string", - path: '{base}.str', - }, - ]); - }); - }); - - describe('minimum/maximum', () => { - it('should handle minimum/maximum errors', () => { - data = { - str: 'str', - bounds: 123, - }; - ajv.validate(schema, data); - const errors = betterAjvErrors({ data, schema, errors: ajv.errors }); - expect(errors).toEqual([ - { - context: { - errorType: 'maximum', - }, - message: "property 'bounds' must be <= 4", - path: '{base}.bounds', - }, - ]); - }); - }); - - describe('enum', () => { - it('should handle enum errors', () => { - data = { - str: 'str', - enum: 'zzzz', - }; - ajv.validate(schema, data); - const errors = betterAjvErrors({ data, schema, errors: ajv.errors }); - expect(errors).toEqual([ - { - context: { - errorType: 'enum', - allowedValues: ['one', 'two'], - }, - message: "'enum' property must be equal to one of the allowed values", - path: '{base}.enum', - }, - ]); - }); - - it('should provide suggestions when relevant', () => { - data = { - str: 'str', - enum: 'pne', - }; - ajv.validate(schema, data); - const errors = betterAjvErrors({ data, schema, errors: ajv.errors }); - expect(errors).toEqual([ - { - context: { - errorType: 'enum', - allowedValues: ['one', 'two'], - }, - message: "'enum' property must be equal to one of the allowed values", - path: '{base}.enum', - suggestion: "Did you mean 'one'?", - }, - ]); - }); - - it('should not crash on null value', () => { - data = { - type: null, - }; - schema = { - type: 'object', - properties: { - type: { - type: 'string', - enum: ['primary', 'secondary'], - }, - }, - }; - ajv.validate(schema, data); - const errors = betterAjvErrors({ data, schema, errors: ajv.errors }); - expect(errors).toEqual([ - { - context: { - allowedValues: ['primary', 'secondary'], - errorType: 'enum', - }, - message: "'type' property must be equal to one of the allowed values", - path: '{base}.type', - }, - ]); - }); - }); - - it('should handle array paths', () => { - data = { - custom: [{ foo: 'bar' }, { aaa: 'zzz' }], - }; - schema = { - type: 'object', - properties: { - custom: { - type: 'array', - items: { - type: 'object', - additionalProperties: false, - properties: { - id: { - type: 'string', - }, - title: { - type: 'string', - }, - }, - }, - }, - }, - }; - ajv.validate(schema, data); - const errors = betterAjvErrors({ data, schema, errors: ajv.errors }); - expect(errors).toEqual([ - { - context: { - errorType: 'additionalProperties', - }, - message: "'foo' property is not expected to be here", - path: '{base}.custom.0', - }, - { - context: { - errorType: 'additionalProperties', - }, - message: "'aaa' property is not expected to be here", - path: '{base}.custom.1', - }, - ]); - }); - - it('should handle file $refs', () => { - data = { - child: [{ foo: 'bar' }, { aaa: 'zzz' }], - }; - schema = { - $id: 'http://example.com/schemas/Main.json', - type: 'object', - properties: { - child: { - type: 'array', - items: { - $ref: './Child.json', - }, - }, - }, - }; - ajv.addSchema({ - $id: 'http://example.com/schemas/Child.json', - additionalProperties: false, - type: 'object', - properties: { - id: { - type: 'string', - }, - }, - }); - ajv.validate(schema, data); - const errors = betterAjvErrors({ data, schema, errors: ajv.errors }); - expect(errors).toEqual([ - { - context: { - errorType: 'additionalProperties', - }, - message: "'foo' property is not expected to be here", - path: '{base}.child.0', - }, - { - context: { - errorType: 'additionalProperties', - }, - message: "'aaa' property is not expected to be here", - path: '{base}.child.1', - }, - ]); - }); - - it('should handle number enums', () => { - data = { - isLive: 2, - }; - schema = { - type: 'object', - properties: { - isLive: { - type: 'integer', - enum: [0, 1], - }, - }, - }; - ajv.validate(schema, data); - const errors = betterAjvErrors({ data, schema, errors: ajv.errors }); - expect(errors).toEqual([ - { - context: { - allowedValues: [0, 1], - errorType: 'enum', - }, - message: "'isLive' property must be equal to one of the allowed values", - path: '{base}.isLive', - }, - ]); - }); - - describe('const', () => { - it('should handle const errors', () => { - data = { - const: 2, - }; - schema = { - type: 'object', - properties: { - const: { - type: 'integer', - const: 42, - }, - }, - }; - ajv.validate(schema, data); - const errors = betterAjvErrors({ data, schema, errors: ajv.errors }); - expect(errors).toEqual([ - { - context: { - allowedValue: 42, - errorType: 'const', - }, - message: "'const' property must be equal to the allowed value", - path: '{base}.const', - }, - ]); - }); - }); -}); diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/index.ts b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/index.ts deleted file mode 100644 index 1601847..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/index.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { DefinedError, ErrorObject } from 'ajv'; -import type { JSONSchema6 } from 'json-schema'; -import { ValidationError } from './types/ValidationError'; -import { filterSingleErrorPerProperty } from './lib/filter'; -import { getSuggestion } from './lib/suggestions'; -import { cleanAjvMessage, getLastSegment, pointerToDotNotation, safeJsonPointer } from './lib/utils'; - -export interface BetterAjvErrorsOptions { - errors: ErrorObject[] | null | undefined; - data: any; - schema: JSONSchema6; - basePath?: string; -} - -export const betterAjvErrors = ({ - errors, - data, - schema, - basePath = '{base}', -}: BetterAjvErrorsOptions): ValidationError[] => { - if (!Array.isArray(errors) || errors.length === 0) { - return []; - } - - const definedErrors = filterSingleErrorPerProperty(errors as DefinedError[]); - - return definedErrors.map((error) => { - const path = pointerToDotNotation(basePath + error.instancePath); - const prop = getLastSegment(error.instancePath); - const defaultContext = { - errorType: error.keyword, - }; - const defaultMessage = `${prop ? `property '${prop}'` : path} ${cleanAjvMessage(error.message as string)}`; - - let validationError: ValidationError; - - switch (error.keyword) { - case 'additionalProperties': { - const additionalProp = error.params.additionalProperty; - const suggestionPointer = error.schemaPath.replace('#', '').replace('/additionalProperties', ''); - const { properties } = safeJsonPointer({ - object: schema, - pnter: suggestionPointer, - fallback: { properties: {} }, - }); - validationError = { - message: `'${additionalProp}' property is not expected to be here`, - suggestion: getSuggestion({ - value: additionalProp, - suggestions: Object.keys(properties ?? {}), - format: (suggestion) => `Did you mean property '${suggestion}'?`, - }), - path, - context: defaultContext, - }; - break; - } - case 'enum': { - const suggestions = error.params.allowedValues.map((value) => value.toString()); - const prop = getLastSegment(error.instancePath); - const value = safeJsonPointer({ object: data, pnter: error.instancePath, fallback: '' }); - validationError = { - message: `'${prop}' property must be equal to one of the allowed values`, - suggestion: getSuggestion({ - value, - suggestions, - }), - path, - context: { - ...defaultContext, - allowedValues: error.params.allowedValues, - }, - }; - break; - } - case 'type': { - const prop = getLastSegment(error.instancePath); - const type = error.params.type; - validationError = { - message: `'${prop}' property type must be ${type}`, - path, - context: defaultContext, - }; - break; - } - case 'required': { - validationError = { - message: `${path} must have required property '${error.params.missingProperty}'`, - path, - context: defaultContext, - }; - break; - } - case 'const': { - return { - message: `'${prop}' property must be equal to the allowed value`, - path, - context: { - ...defaultContext, - allowedValue: error.params.allowedValue, - }, - }; - } - - default: - return { message: defaultMessage, path, context: defaultContext }; - } - - // Remove empty properties - const errorEntries = Object.entries(validationError); - for (const [key, value] of errorEntries as [keyof ValidationError, unknown][]) { - if (value === null || value === undefined || value === '') { - delete validationError[key]; - } - } - - return validationError; - }); -}; - -export { ValidationError }; diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/lib/filter.ts b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/lib/filter.ts deleted file mode 100644 index 8110ce2..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/lib/filter.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { DefinedError } from 'ajv'; -import { AJV_ERROR_KEYWORD_WEIGHT_MAP } from '../constants'; - -export const filterSingleErrorPerProperty = (errors: DefinedError[]): DefinedError[] => { - const errorsPerProperty = errors.reduce>((acc, error) => { - const prop = - error.instancePath + ((error.params as any)?.additionalProperty ?? (error.params as any)?.missingProperty ?? ''); - const existingError = acc[prop]; - if (!existingError) { - acc[prop] = error; - return acc; - } - const weight = AJV_ERROR_KEYWORD_WEIGHT_MAP[error.keyword] ?? 0; - const existingWeight = AJV_ERROR_KEYWORD_WEIGHT_MAP[existingError.keyword] ?? 0; - - if (weight > existingWeight) { - acc[prop] = error; - } - return acc; - }, {}); - - return Object.values(errorsPerProperty); -}; diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/lib/suggestions.ts b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/lib/suggestions.ts deleted file mode 100644 index 0768867..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/lib/suggestions.ts +++ /dev/null @@ -1,29 +0,0 @@ -import leven from 'leven'; - -export const getSuggestion = ({ - value, - suggestions, - format = (suggestion) => `Did you mean '${suggestion}'?`, -}: { - value: string | null; - suggestions: string[]; - format?: (suggestion: string) => string; -}): string => { - if (!value) return ''; - const bestSuggestion = suggestions.reduce( - (best, current) => { - const distance = leven(value, current); - if (best.distance > distance) { - return { value: current, distance }; - } - - return best; - }, - { - distance: Infinity, - value: '', - } - ); - - return bestSuggestion.distance < value.length ? format(bestSuggestion.value) : ''; -}; diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/lib/utils.ts b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/lib/utils.ts deleted file mode 100644 index 2baf5d9..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/lib/utils.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { NOT_REGEX, QUOTES_REGEX, SLASH_REGEX } from '../constants'; -import pointer from 'jsonpointer'; - -export const pointerToDotNotation = (pointer: string): string => { - return pointer.replace(SLASH_REGEX, '.'); -}; - -export const cleanAjvMessage = (message: string): string => { - return message.replace(QUOTES_REGEX, "'").replace(NOT_REGEX, 'not'); -}; - -export const getLastSegment = (path: string): string => { - const segments = path.split('/'); - return segments.pop() as string; -}; - -export const safeJsonPointer = ({ object, pnter, fallback }: { object: any; pnter: string; fallback: T }): T => { - try { - return pointer.get(object, pnter); - } catch (err) { - return fallback; - } -}; diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/types/ValidationError.ts b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/types/ValidationError.ts deleted file mode 100644 index 8f8e4c3..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@apideck/better-ajv-errors/src/types/ValidationError.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { DefinedError } from 'ajv'; - -export interface ValidationError { - message: string; - path: string; - suggestion?: string; - context: { - errorType: DefinedError['keyword']; - [additionalContext: string]: unknown; - }; -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/code-frame/LICENSE b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/code-frame/LICENSE deleted file mode 100644 index f31575e..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/code-frame/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/code-frame/README.md b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/code-frame/README.md deleted file mode 100644 index 08cacb0..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/code-frame/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/code-frame - -> Generate errors that contain a code frame that point to source locations. - -See our website [@babel/code-frame](https://babeljs.io/docs/en/babel-code-frame) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/code-frame -``` - -or using yarn: - -```sh -yarn add @babel/code-frame --dev -``` diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/code-frame/lib/index.js b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/code-frame/lib/index.js deleted file mode 100644 index cba3f83..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/code-frame/lib/index.js +++ /dev/null @@ -1,163 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.codeFrameColumns = codeFrameColumns; -exports.default = _default; - -var _highlight = require("@babel/highlight"); - -let deprecationWarningShown = false; - -function getDefs(chalk) { - return { - gutter: chalk.grey, - marker: chalk.red.bold, - message: chalk.red.bold - }; -} - -const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; - -function getMarkerLines(loc, source, opts) { - const startLoc = Object.assign({ - column: 0, - line: -1 - }, loc.start); - const endLoc = Object.assign({}, startLoc, loc.end); - const { - linesAbove = 2, - linesBelow = 3 - } = opts || {}; - const startLine = startLoc.line; - const startColumn = startLoc.column; - const endLine = endLoc.line; - const endColumn = endLoc.column; - let start = Math.max(startLine - (linesAbove + 1), 0); - let end = Math.min(source.length, endLine + linesBelow); - - if (startLine === -1) { - start = 0; - } - - if (endLine === -1) { - end = source.length; - } - - const lineDiff = endLine - startLine; - const markerLines = {}; - - if (lineDiff) { - for (let i = 0; i <= lineDiff; i++) { - const lineNumber = i + startLine; - - if (!startColumn) { - markerLines[lineNumber] = true; - } else if (i === 0) { - const sourceLength = source[lineNumber - 1].length; - markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; - } else if (i === lineDiff) { - markerLines[lineNumber] = [0, endColumn]; - } else { - const sourceLength = source[lineNumber - i].length; - markerLines[lineNumber] = [0, sourceLength]; - } - } - } else { - if (startColumn === endColumn) { - if (startColumn) { - markerLines[startLine] = [startColumn, 0]; - } else { - markerLines[startLine] = true; - } - } else { - markerLines[startLine] = [startColumn, endColumn - startColumn]; - } - } - - return { - start, - end, - markerLines - }; -} - -function codeFrameColumns(rawLines, loc, opts = {}) { - const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts); - const chalk = (0, _highlight.getChalk)(opts); - const defs = getDefs(chalk); - - const maybeHighlight = (chalkFn, string) => { - return highlighted ? chalkFn(string) : string; - }; - - const lines = rawLines.split(NEWLINE); - const { - start, - end, - markerLines - } = getMarkerLines(loc, lines, opts); - const hasColumns = loc.start && typeof loc.start.column === "number"; - const numberMaxWidth = String(end).length; - const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines; - let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => { - const number = start + 1 + index; - const paddedNumber = ` ${number}`.slice(-numberMaxWidth); - const gutter = ` ${paddedNumber} |`; - const hasMarker = markerLines[number]; - const lastMarkerLine = !markerLines[number + 1]; - - if (hasMarker) { - let markerLine = ""; - - if (Array.isArray(hasMarker)) { - const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); - const numberOfMarkers = hasMarker[1] || 1; - markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); - - if (lastMarkerLine && opts.message) { - markerLine += " " + maybeHighlight(defs.message, opts.message); - } - } - - return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join(""); - } else { - return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`; - } - }).join("\n"); - - if (opts.message && !hasColumns) { - frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`; - } - - if (highlighted) { - return chalk.reset(frame); - } else { - return frame; - } -} - -function _default(rawLines, lineNumber, colNumber, opts = {}) { - if (!deprecationWarningShown) { - deprecationWarningShown = true; - const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; - - if (process.emitWarning) { - process.emitWarning(message, "DeprecationWarning"); - } else { - const deprecationError = new Error(message); - deprecationError.name = "DeprecationWarning"; - console.warn(new Error(message)); - } - } - - colNumber = Math.max(colNumber, 0); - const location = { - start: { - column: colNumber, - line: lineNumber - } - }; - return codeFrameColumns(rawLines, location, opts); -} \ No newline at end of file diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/code-frame/package.json b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/code-frame/package.json deleted file mode 100644 index 18d8db1..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/code-frame/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "@babel/code-frame", - "version": "7.18.6", - "description": "Generate errors that contain a code frame that point to source locations.", - "author": "The Babel Team (https://babel.dev/team)", - "homepage": "https://babel.dev/docs/en/next/babel-code-frame", - "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-code-frame" - }, - "main": "./lib/index.js", - "dependencies": { - "@babel/highlight": "^7.18.6" - }, - "devDependencies": { - "@types/chalk": "^2.0.0", - "chalk": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "type": "commonjs" -} \ No newline at end of file diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/LICENSE b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/LICENSE deleted file mode 100644 index f31575e..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/README.md b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/README.md deleted file mode 100644 index 4f704c4..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-validator-identifier - -> Validate identifier/keywords name - -See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/en/babel-helper-validator-identifier) for more information. - -## Install - -Using npm: - -```sh -npm install --save @babel/helper-validator-identifier -``` - -or using yarn: - -```sh -yarn add @babel/helper-validator-identifier -``` diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/identifier.js b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/identifier.js deleted file mode 100644 index 3a9e335..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/identifier.js +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isIdentifierChar = isIdentifierChar; -exports.isIdentifierName = isIdentifierName; -exports.isIdentifierStart = isIdentifierStart; -let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; -let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; -const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); -const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; -const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191]; -const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; - -function isInAstralSet(code, set) { - let pos = 0x10000; - - for (let i = 0, length = set.length; i < length; i += 2) { - pos += set[i]; - if (pos > code) return false; - pos += set[i + 1]; - if (pos >= code) return true; - } - - return false; -} - -function isIdentifierStart(code) { - if (code < 65) return code === 36; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes); -} - -function isIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); -} - -function isIdentifierName(name) { - let isFirst = true; - - for (let i = 0; i < name.length; i++) { - let cp = name.charCodeAt(i); - - if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) { - const trail = name.charCodeAt(++i); - - if ((trail & 0xfc00) === 0xdc00) { - cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); - } - } - - if (isFirst) { - isFirst = false; - - if (!isIdentifierStart(cp)) { - return false; - } - } else if (!isIdentifierChar(cp)) { - return false; - } - } - - return !isFirst; -} - -//# sourceMappingURL=identifier.js.map diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map deleted file mode 100644 index 45c94ff..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["nonASCIIidentifierStartChars","nonASCIIidentifierChars","nonASCIIidentifierStart","RegExp","nonASCIIidentifier","astralIdentifierStartCodes","astralIdentifierCodes","isInAstralSet","code","set","pos","i","length","isIdentifierStart","test","String","fromCharCode","isIdentifierChar","isIdentifierName","name","isFirst","cp","charCodeAt","trail"],"sources":["../src/identifier.ts"],"sourcesContent":["import * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.js`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\ua7f2-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0898-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.js`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n"],"mappings":";;;;;;;;AAWA,IAAIA,4BAA4B,GAAG,8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oBR,IAApB,CAAxB,CAAvB;EACD;;EACD,OACED,aAAa,CAACC,IAAD,EAAOH,0BAAP,CAAb,IACAE,aAAa,CAACC,IAAD,EAAOF,qBAAP,CAFf;AAID;;AAIM,SAASY,gBAAT,CAA0BC,IAA1B,EAAiD;EACtD,IAAIC,OAAO,GAAG,IAAd;;EACA,KAAK,IAAIT,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGQ,IAAI,CAACP,MAAzB,EAAiCD,CAAC,EAAlC,EAAsC;IAKpC,IAAIU,EAAE,GAAGF,IAAI,CAACG,UAAL,CAAgBX,CAAhB,CAAT;;IACA,IAAI,CAACU,EAAE,GAAG,MAAN,MAAkB,MAAlB,IAA4BV,CAAC,GAAG,CAAJ,GAAQQ,IAAI,CAACP,MAA7C,EAAqD;MACnD,MAAMW,KAAK,GAAGJ,IAAI,CAACG,UAAL,CAAgB,EAAEX,CAAlB,CAAd;;MACA,IAAI,CAACY,KAAK,GAAG,MAAT,MAAqB,MAAzB,EAAiC;QAC/BF,EAAE,GAAG,WAAW,CAACA,EAAE,GAAG,KAAN,KAAgB,EAA3B,KAAkCE,KAAK,GAAG,KAA1C,CAAL;MACD;IACF;;IACD,IAAIH,OAAJ,EAAa;MACXA,OAAO,GAAG,KAAV;;MACA,IAAI,CAACP,iBAAiB,CAACQ,EAAD,CAAtB,EAA4B;QAC1B,OAAO,KAAP;MACD;IACF,CALD,MAKO,IAAI,CAACJ,gBAAgB,CAACI,EAAD,CAArB,EAA2B;MAChC,OAAO,KAAP;IACD;EACF;;EACD,OAAO,CAACD,OAAR;AACD"} \ No newline at end of file diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/index.js b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/index.js deleted file mode 100644 index 076eafd..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/index.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "isIdentifierChar", { - enumerable: true, - get: function () { - return _identifier.isIdentifierChar; - } -}); -Object.defineProperty(exports, "isIdentifierName", { - enumerable: true, - get: function () { - return _identifier.isIdentifierName; - } -}); -Object.defineProperty(exports, "isIdentifierStart", { - enumerable: true, - get: function () { - return _identifier.isIdentifierStart; - } -}); -Object.defineProperty(exports, "isKeyword", { - enumerable: true, - get: function () { - return _keyword.isKeyword; - } -}); -Object.defineProperty(exports, "isReservedWord", { - enumerable: true, - get: function () { - return _keyword.isReservedWord; - } -}); -Object.defineProperty(exports, "isStrictBindOnlyReservedWord", { - enumerable: true, - get: function () { - return _keyword.isStrictBindOnlyReservedWord; - } -}); -Object.defineProperty(exports, "isStrictBindReservedWord", { - enumerable: true, - get: function () { - return _keyword.isStrictBindReservedWord; - } -}); -Object.defineProperty(exports, "isStrictReservedWord", { - enumerable: true, - get: function () { - return _keyword.isStrictReservedWord; - } -}); - -var _identifier = require("./identifier"); - -var _keyword = require("./keyword"); - -//# sourceMappingURL=index.js.map diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/index.js.map b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/index.js.map deleted file mode 100644 index 13266b9..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":[],"sources":["../src/index.ts"],"sourcesContent":["export {\n isIdentifierName,\n isIdentifierChar,\n isIdentifierStart,\n} from \"./identifier\";\nexport {\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"./keyword\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAKA"} \ No newline at end of file diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/keyword.js b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/keyword.js deleted file mode 100644 index ff6277b..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/keyword.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isKeyword = isKeyword; -exports.isReservedWord = isReservedWord; -exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; -exports.isStrictBindReservedWord = isStrictBindReservedWord; -exports.isStrictReservedWord = isStrictReservedWord; -const reservedWords = { - keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], - strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], - strictBind: ["eval", "arguments"] -}; -const keywords = new Set(reservedWords.keyword); -const reservedWordsStrictSet = new Set(reservedWords.strict); -const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); - -function isReservedWord(word, inModule) { - return inModule && word === "await" || word === "enum"; -} - -function isStrictReservedWord(word, inModule) { - return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); -} - -function isStrictBindOnlyReservedWord(word) { - return reservedWordsStrictBindSet.has(word); -} - -function isStrictBindReservedWord(word, inModule) { - return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); -} - -function isKeyword(word) { - return keywords.has(word); -} - -//# sourceMappingURL=keyword.js.map diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map deleted file mode 100644 index 2de8c3e..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["reservedWords","keyword","strict","strictBind","keywords","Set","reservedWordsStrictSet","reservedWordsStrictBindSet","isReservedWord","word","inModule","isStrictReservedWord","has","isStrictBindOnlyReservedWord","isStrictBindReservedWord","isKeyword"],"sources":["../src/keyword.ts"],"sourcesContent":["const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n"],"mappings":";;;;;;;;;;AAAA,MAAMA,aAAa,GAAG;EACpBC,OAAO,EAAE,CACP,OADO,EAEP,MAFO,EAGP,OAHO,EAIP,UAJO,EAKP,UALO,EAMP,SANO,EAOP,IAPO,EAQP,MARO,EASP,SATO,EAUP,KAVO,EAWP,UAXO,EAYP,IAZO,EAaP,QAbO,EAcP,QAdO,EAeP,OAfO,EAgBP,KAhBO,EAiBP,KAjBO,EAkBP,OAlBO,EAmBP,OAnBO,EAoBP,MApBO,EAqBP,KArBO,EAsBP,MAtBO,EAuBP,OAvBO,EAwBP,OAxBO,EAyBP,SAzBO,EA0BP,QA1BO,EA2BP,QA3BO,EA4BP,MA5BO,EA6BP,MA7BO,EA8BP,OA9BO,EA+BP,IA/BO,EAgCP,YAhCO,EAiCP,QAjCO,EAkCP,MAlCO,EAmCP,QAnCO,CADW;EAsCpBC,MAAM,EAAE,CACN,YADM,EAEN,WAFM,EAGN,KAHM,EAIN,SAJM,EAKN,SALM,EAMN,WANM,EAON,QAPM,EAQN,QARM,EASN,OATM,CAtCY;EAiDpBC,UAAU,EAAE,CAAC,MAAD,EAAS,WAAT;AAjDQ,CAAtB;AAmDA,MAAMC,QAAQ,GAAG,IAAIC,GAAJ,CAAQL,aAAa,CAACC,OAAtB,CAAjB;AACA,MAAMK,sBAAsB,GAAG,IAAID,GAAJ,CAAQL,aAAa,CAACE,MAAtB,CAA/B;AACA,MAAMK,0BAA0B,GAAG,IAAIF,GAAJ,CAAQL,aAAa,CAACG,UAAtB,CAAnC;;AAKO,SAASK,cAAT,CAAwBC,IAAxB,EAAsCC,QAAtC,EAAkE;EACvE,OAAQA,QAAQ,IAAID,IAAI,KAAK,OAAtB,IAAkCA,IAAI,KAAK,MAAlD;AACD;;AAOM,SAASE,oBAAT,CAA8BF,IAA9B,EAA4CC,QAA5C,EAAwE;EAC7E,OAAOF,cAAc,CAACC,IAAD,EAAOC,QAAP,CAAd,IAAkCJ,sBAAsB,CAACM,GAAvB,CAA2BH,IAA3B,CAAzC;AACD;;AAMM,SAASI,4BAAT,CAAsCJ,IAAtC,EAA6D;EAClE,OAAOF,0BAA0B,CAACK,GAA3B,CAA+BH,IAA/B,CAAP;AACD;;AAOM,SAASK,wBAAT,CACLL,IADK,EAELC,QAFK,EAGI;EACT,OACEC,oBAAoB,CAACF,IAAD,EAAOC,QAAP,CAApB,IAAwCG,4BAA4B,CAACJ,IAAD,CADtE;AAGD;;AAEM,SAASM,SAAT,CAAmBN,IAAnB,EAA0C;EAC/C,OAAOL,QAAQ,CAACQ,GAAT,CAAaH,IAAb,CAAP;AACD"} \ No newline at end of file diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/package.json b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/package.json deleted file mode 100644 index 6e7de1e..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@babel/helper-validator-identifier", - "version": "7.19.1", - "description": "Validate identifier/keywords name", - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-helper-validator-identifier" - }, - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "main": "./lib/index.js", - "exports": { - ".": "./lib/index.js", - "./package.json": "./package.json" - }, - "devDependencies": { - "@unicode/unicode-15.0.0": "^1.3.1", - "charcodes": "^0.2.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "author": "The Babel Team (https://babel.dev/team)", - "type": "commonjs" -} \ No newline at end of file diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js deleted file mode 100644 index aca8710..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; - -// Always use the latest available version of Unicode! -// https://tc39.github.io/ecma262/#sec-conformance -const version = "15.0.0"; - -const start = require("@unicode/unicode-" + - version + - "/Binary_Property/ID_Start/code-points.js").filter(function (ch) { - return ch > 0x7f; -}); -let last = -1; -const cont = [0x200c, 0x200d].concat( - require("@unicode/unicode-" + - version + - "/Binary_Property/ID_Continue/code-points.js").filter(function (ch) { - return ch > 0x7f && search(start, ch, last + 1) == -1; - }) -); - -function search(arr, ch, starting) { - for (let i = starting; arr[i] <= ch && i < arr.length; last = i++) { - if (arr[i] === ch) return i; - } - return -1; -} - -function pad(str, width) { - while (str.length < width) str = "0" + str; - return str; -} - -function esc(code) { - const hex = code.toString(16); - if (hex.length <= 2) return "\\x" + pad(hex, 2); - else return "\\u" + pad(hex, 4); -} - -function generate(chars) { - const astral = []; - let re = ""; - for (let i = 0, at = 0x10000; i < chars.length; i++) { - const from = chars[i]; - let to = from; - while (i < chars.length - 1 && chars[i + 1] == to + 1) { - i++; - to++; - } - if (to <= 0xffff) { - if (from == to) re += esc(from); - else if (from + 1 == to) re += esc(from) + esc(to); - else re += esc(from) + "-" + esc(to); - } else { - astral.push(from - at, to - from); - at = to; - } - } - return { nonASCII: re, astral: astral }; -} - -const startData = generate(start); -const contData = generate(cont); - -console.log("/* prettier-ignore */"); -console.log('let nonASCIIidentifierStartChars = "' + startData.nonASCII + '";'); -console.log("/* prettier-ignore */"); -console.log('let nonASCIIidentifierChars = "' + contData.nonASCII + '";'); -console.log("/* prettier-ignore */"); -console.log( - "const astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";" -); -console.log("/* prettier-ignore */"); -console.log( - "const astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";" -); diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/LICENSE b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/LICENSE deleted file mode 100644 index f31575e..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/README.md b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/README.md deleted file mode 100644 index f8887ad..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/highlight - -> Syntax highlight JavaScript strings for output in terminals. - -See our website [@babel/highlight](https://babeljs.io/docs/en/babel-highlight) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/highlight -``` - -or using yarn: - -```sh -yarn add @babel/highlight --dev -``` diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/lib/index.js b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/lib/index.js deleted file mode 100644 index 856dfd9..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/lib/index.js +++ /dev/null @@ -1,116 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = highlight; -exports.getChalk = getChalk; -exports.shouldHighlight = shouldHighlight; - -var _jsTokens = require("js-tokens"); - -var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); - -var _chalk = require("chalk"); - -const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]); - -function getDefs(chalk) { - return { - keyword: chalk.cyan, - capitalized: chalk.yellow, - jsxIdentifier: chalk.yellow, - punctuator: chalk.yellow, - number: chalk.magenta, - string: chalk.green, - regex: chalk.magenta, - comment: chalk.grey, - invalid: chalk.white.bgRed.bold - }; -} - -const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; -const BRACKET = /^[()[\]{}]$/; -let tokenize; -{ - const JSX_TAG = /^[a-z][\w-]*$/i; - - const getTokenType = function (token, offset, text) { - if (token.type === "name") { - if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) { - return "keyword"; - } - - if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) == " colorize(str)).join("\n"); - } else { - highlighted += value; - } - } - - return highlighted; -} - -function shouldHighlight(options) { - return !!_chalk.supportsColor || options.forceColor; -} - -function getChalk(options) { - return options.forceColor ? new _chalk.constructor({ - enabled: true, - level: 1 - }) : _chalk; -} - -function highlight(code, options = {}) { - if (code !== "" && shouldHighlight(options)) { - const chalk = getChalk(options); - const defs = getDefs(chalk); - return highlightTokens(defs, code); - } else { - return code; - } -} \ No newline at end of file diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/ansi-styles/index.js b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/ansi-styles/index.js deleted file mode 100644 index 90a871c..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/ansi-styles/index.js +++ /dev/null @@ -1,165 +0,0 @@ -'use strict'; -const colorConvert = require('color-convert'); - -const wrapAnsi16 = (fn, offset) => function () { - const code = fn.apply(colorConvert, arguments); - return `\u001B[${code + offset}m`; -}; - -const wrapAnsi256 = (fn, offset) => function () { - const code = fn.apply(colorConvert, arguments); - return `\u001B[${38 + offset};5;${code}m`; -}; - -const wrapAnsi16m = (fn, offset) => function () { - const rgb = fn.apply(colorConvert, arguments); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; - -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - gray: [90, 39], - - // Bright color - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - - // Fix humans - styles.color.grey = styles.color.gray; - - for (const groupName of Object.keys(styles)) { - const group = styles[groupName]; - - for (const styleName of Object.keys(group)) { - const style = group[styleName]; - - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; - - group[styleName] = styles[styleName]; - - codes.set(style[0], style[1]); - } - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); - } - - const ansi2ansi = n => n; - const rgb2rgb = (r, g, b) => [r, g, b]; - - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; - - styles.color.ansi = { - ansi: wrapAnsi16(ansi2ansi, 0) - }; - styles.color.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 0) - }; - styles.color.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 0) - }; - - styles.bgColor.ansi = { - ansi: wrapAnsi16(ansi2ansi, 10) - }; - styles.bgColor.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 10) - }; - styles.bgColor.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 10) - }; - - for (let key of Object.keys(colorConvert)) { - if (typeof colorConvert[key] !== 'object') { - continue; - } - - const suite = colorConvert[key]; - - if (key === 'ansi16') { - key = 'ansi'; - } - - if ('ansi16' in suite) { - styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); - styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); - } - - if ('ansi256' in suite) { - styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); - styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); - } - - if ('rgb' in suite) { - styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); - styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); - } - } - - return styles; -} - -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/ansi-styles/license b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/ansi-styles/license deleted file mode 100644 index e7af2f7..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/ansi-styles/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/ansi-styles/package.json b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/ansi-styles/package.json deleted file mode 100644 index 65edb48..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "ansi-styles", - "version": "3.2.1", - "description": "ANSI escape codes for styling strings in the terminal", - "license": "MIT", - "repository": "chalk/ansi-styles", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava", - "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" - }, - "files": [ - "index.js" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "color-convert": "^1.9.0" - }, - "devDependencies": { - "ava": "*", - "babel-polyfill": "^6.23.0", - "svg-term-cli": "^2.1.1", - "xo": "*" - }, - "ava": { - "require": "babel-polyfill" - } -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/ansi-styles/readme.md b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/ansi-styles/readme.md deleted file mode 100644 index 3158e2d..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/ansi-styles/readme.md +++ /dev/null @@ -1,147 +0,0 @@ -# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) - -> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal - -You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. - - - - -## Install - -``` -$ npm install ansi-styles -``` - - -## Usage - -```js -const style = require('ansi-styles'); - -console.log(`${style.green.open}Hello world!${style.green.close}`); - - -// Color conversion between 16/256/truecolor -// NOTE: If conversion goes to 16 colors or 256 colors, the original color -// may be degraded to fit that color palette. This means terminals -// that do not support 16 million colors will best-match the -// original color. -console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); -console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); -console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close); -``` - -## API - -Each style has an `open` and `close` property. - - -## Styles - -### Modifiers - -- `reset` -- `bold` -- `dim` -- `italic` *(Not widely supported)* -- `underline` -- `inverse` -- `hidden` -- `strikethrough` *(Not widely supported)* - -### Colors - -- `black` -- `red` -- `green` -- `yellow` -- `blue` -- `magenta` -- `cyan` -- `white` -- `gray` ("bright black") -- `redBright` -- `greenBright` -- `yellowBright` -- `blueBright` -- `magentaBright` -- `cyanBright` -- `whiteBright` - -### Background colors - -- `bgBlack` -- `bgRed` -- `bgGreen` -- `bgYellow` -- `bgBlue` -- `bgMagenta` -- `bgCyan` -- `bgWhite` -- `bgBlackBright` -- `bgRedBright` -- `bgGreenBright` -- `bgYellowBright` -- `bgBlueBright` -- `bgMagentaBright` -- `bgCyanBright` -- `bgWhiteBright` - - -## Advanced usage - -By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. - -- `style.modifier` -- `style.color` -- `style.bgColor` - -###### Example - -```js -console.log(style.color.green.open); -``` - -Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. - -###### Example - -```js -console.log(style.codes.get(36)); -//=> 39 -``` - - -## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) - -`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. - -To use these, call the associated conversion function with the intended output, for example: - -```js -style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code -style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code - -style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code -style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code - -style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code -style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code -``` - - -## Related - -- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/chalk/index.js b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/chalk/index.js deleted file mode 100644 index 1cc5fa8..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/chalk/index.js +++ /dev/null @@ -1,228 +0,0 @@ -'use strict'; -const escapeStringRegexp = require('escape-string-regexp'); -const ansiStyles = require('ansi-styles'); -const stdoutColor = require('supports-color').stdout; - -const template = require('./templates.js'); - -const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); - -// `supportsColor.level` → `ansiStyles.color[name]` mapping -const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; - -// `color-convert` models to exclude from the Chalk API due to conflicts and such -const skipModels = new Set(['gray']); - -const styles = Object.create(null); - -function applyOptions(obj, options) { - options = options || {}; - - // Detect level if not set manually - const scLevel = stdoutColor ? stdoutColor.level : 0; - obj.level = options.level === undefined ? scLevel : options.level; - obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; -} - -function Chalk(options) { - // We check for this.template here since calling `chalk.constructor()` - // by itself will have a `this` of a previously constructed chalk object - if (!this || !(this instanceof Chalk) || this.template) { - const chalk = {}; - applyOptions(chalk, options); - - chalk.template = function () { - const args = [].slice.call(arguments); - return chalkTag.apply(null, [chalk.template].concat(args)); - }; - - Object.setPrototypeOf(chalk, Chalk.prototype); - Object.setPrototypeOf(chalk.template, chalk); - - chalk.template.constructor = Chalk; - - return chalk.template; - } - - applyOptions(this, options); -} - -// Use bright blue on Windows as the normal blue color is illegible -if (isSimpleWindowsTerm) { - ansiStyles.blue.open = '\u001B[94m'; -} - -for (const key of Object.keys(ansiStyles)) { - ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); - - styles[key] = { - get() { - const codes = ansiStyles[key]; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); - } - }; -} - -styles.visible = { - get() { - return build.call(this, this._styles || [], true, 'visible'); - } -}; - -ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); -for (const model of Object.keys(ansiStyles.color.ansi)) { - if (skipModels.has(model)) { - continue; - } - - styles[model] = { - get() { - const level = this.level; - return function () { - const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); - const codes = { - open, - close: ansiStyles.color.close, - closeRe: ansiStyles.color.closeRe - }; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); - }; - } - }; -} - -ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); -for (const model of Object.keys(ansiStyles.bgColor.ansi)) { - if (skipModels.has(model)) { - continue; - } - - const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { - get() { - const level = this.level; - return function () { - const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); - const codes = { - open, - close: ansiStyles.bgColor.close, - closeRe: ansiStyles.bgColor.closeRe - }; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); - }; - } - }; -} - -const proto = Object.defineProperties(() => {}, styles); - -function build(_styles, _empty, key) { - const builder = function () { - return applyStyle.apply(builder, arguments); - }; - - builder._styles = _styles; - builder._empty = _empty; - - const self = this; - - Object.defineProperty(builder, 'level', { - enumerable: true, - get() { - return self.level; - }, - set(level) { - self.level = level; - } - }); - - Object.defineProperty(builder, 'enabled', { - enumerable: true, - get() { - return self.enabled; - }, - set(enabled) { - self.enabled = enabled; - } - }); - - // See below for fix regarding invisible grey/dim combination on Windows - builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; - - // `__proto__` is used because we must return a function, but there is - // no way to create a function with a different prototype - builder.__proto__ = proto; // eslint-disable-line no-proto - - return builder; -} - -function applyStyle() { - // Support varags, but simply cast to string in case there's only one arg - const args = arguments; - const argsLen = args.length; - let str = String(arguments[0]); - - if (argsLen === 0) { - return ''; - } - - if (argsLen > 1) { - // Don't slice `arguments`, it prevents V8 optimizations - for (let a = 1; a < argsLen; a++) { - str += ' ' + args[a]; - } - } - - if (!this.enabled || this.level <= 0 || !str) { - return this._empty ? '' : str; - } - - // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, - // see https://github.com/chalk/chalk/issues/58 - // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. - const originalDim = ansiStyles.dim.open; - if (isSimpleWindowsTerm && this.hasGrey) { - ansiStyles.dim.open = ''; - } - - for (const code of this._styles.slice().reverse()) { - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - str = code.open + str.replace(code.closeRe, code.open) + code.close; - - // Close the styling before a linebreak and reopen - // after next line to fix a bleed issue on macOS - // https://github.com/chalk/chalk/pull/92 - str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); - } - - // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue - ansiStyles.dim.open = originalDim; - - return str; -} - -function chalkTag(chalk, strings) { - if (!Array.isArray(strings)) { - // If chalk() was called by itself or with a string, - // return the string itself as a string. - return [].slice.call(arguments, 1).join(' '); - } - - const args = [].slice.call(arguments, 2); - const parts = [strings.raw[0]]; - - for (let i = 1; i < strings.length; i++) { - parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); - parts.push(String(strings.raw[i])); - } - - return template(chalk, parts.join('')); -} - -Object.defineProperties(Chalk.prototype, styles); - -module.exports = Chalk(); // eslint-disable-line new-cap -module.exports.supportsColor = stdoutColor; -module.exports.default = module.exports; // For TypeScript diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/chalk/index.js.flow b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/chalk/index.js.flow deleted file mode 100644 index 622caaa..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/chalk/index.js.flow +++ /dev/null @@ -1,93 +0,0 @@ -// @flow strict - -type TemplateStringsArray = $ReadOnlyArray; - -export type Level = $Values<{ - None: 0, - Basic: 1, - Ansi256: 2, - TrueColor: 3 -}>; - -export type ChalkOptions = {| - enabled?: boolean, - level?: Level -|}; - -export type ColorSupport = {| - level: Level, - hasBasic: boolean, - has256: boolean, - has16m: boolean -|}; - -export interface Chalk { - (...text: string[]): string, - (text: TemplateStringsArray, ...placeholders: string[]): string, - constructor(options?: ChalkOptions): Chalk, - enabled: boolean, - level: Level, - rgb(r: number, g: number, b: number): Chalk, - hsl(h: number, s: number, l: number): Chalk, - hsv(h: number, s: number, v: number): Chalk, - hwb(h: number, w: number, b: number): Chalk, - bgHex(color: string): Chalk, - bgKeyword(color: string): Chalk, - bgRgb(r: number, g: number, b: number): Chalk, - bgHsl(h: number, s: number, l: number): Chalk, - bgHsv(h: number, s: number, v: number): Chalk, - bgHwb(h: number, w: number, b: number): Chalk, - hex(color: string): Chalk, - keyword(color: string): Chalk, - - +reset: Chalk, - +bold: Chalk, - +dim: Chalk, - +italic: Chalk, - +underline: Chalk, - +inverse: Chalk, - +hidden: Chalk, - +strikethrough: Chalk, - - +visible: Chalk, - - +black: Chalk, - +red: Chalk, - +green: Chalk, - +yellow: Chalk, - +blue: Chalk, - +magenta: Chalk, - +cyan: Chalk, - +white: Chalk, - +gray: Chalk, - +grey: Chalk, - +blackBright: Chalk, - +redBright: Chalk, - +greenBright: Chalk, - +yellowBright: Chalk, - +blueBright: Chalk, - +magentaBright: Chalk, - +cyanBright: Chalk, - +whiteBright: Chalk, - - +bgBlack: Chalk, - +bgRed: Chalk, - +bgGreen: Chalk, - +bgYellow: Chalk, - +bgBlue: Chalk, - +bgMagenta: Chalk, - +bgCyan: Chalk, - +bgWhite: Chalk, - +bgBlackBright: Chalk, - +bgRedBright: Chalk, - +bgGreenBright: Chalk, - +bgYellowBright: Chalk, - +bgBlueBright: Chalk, - +bgMagentaBright: Chalk, - +bgCyanBright: Chalk, - +bgWhiteBrigh: Chalk, - - supportsColor: ColorSupport -}; - -declare module.exports: Chalk; diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/chalk/license b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/chalk/license deleted file mode 100644 index e7af2f7..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/chalk/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/chalk/package.json b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/chalk/package.json deleted file mode 100644 index bc32468..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/chalk/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "chalk", - "version": "2.4.2", - "description": "Terminal string styling done right", - "license": "MIT", - "repository": "chalk/chalk", - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava", - "bench": "matcha benchmark.js", - "coveralls": "nyc report --reporter=text-lcov | coveralls" - }, - "files": [ - "index.js", - "templates.js", - "types/index.d.ts", - "index.js.flow" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "str", - "ansi", - "style", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "devDependencies": { - "ava": "*", - "coveralls": "^3.0.0", - "execa": "^0.9.0", - "flow-bin": "^0.68.0", - "import-fresh": "^2.0.0", - "matcha": "^0.7.0", - "nyc": "^11.0.2", - "resolve-from": "^4.0.0", - "typescript": "^2.5.3", - "xo": "*" - }, - "types": "types/index.d.ts", - "xo": { - "envs": [ - "node", - "mocha" - ], - "ignores": [ - "test/_flow.js" - ] - } -} diff --git a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/chalk/readme.md b/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/chalk/readme.md deleted file mode 100644 index d298e2c..0000000 --- a/vendor/lib/node_modules/@socketsecurity/cli/node_modules/@babel/highlight/node_modules/chalk/readme.md +++ /dev/null @@ -1,314 +0,0 @@ -

-
-
- Chalk -
-
-
-

- -> Terminal string styling done right - -[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs) - -### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0) - - - - -## Highlights - -- Expressive API -- Highly performant -- Ability to nest styles -- [256/Truecolor color support](#256-and-truecolor-color-support) -- Auto-detects color support -- Doesn't extend `String.prototype` -- Clean and focused -- Actively maintained -- [Used by ~23,000 packages](https://www.npmjs.com/browse/depended/chalk) as of December 31, 2017 - - -## Install - -```console -$ npm install chalk -``` - - - - - - -## Usage - -```js -const chalk = require('chalk'); - -console.log(chalk.blue('Hello world!')); -``` - -Chalk comes with an easy to use composable API where you just chain and nest the styles you want. - -```js -const chalk = require('chalk'); -const log = console.log; - -// Combine styled and normal strings -log(chalk.blue('Hello') + ' World' + chalk.red('!')); - -// Compose multiple styles using the chainable API -log(chalk.blue.bgRed.bold('Hello world!')); - -// Pass in multiple arguments -log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); - -// Nest styles -log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); - -// Nest styles of the same type even (color, underline, background) -log(chalk.green( - 'I am a green line ' + - chalk.blue.underline.bold('with a blue substring') + - ' that becomes green again!' -)); - -// ES2015 template literal -log(` -CPU: ${chalk.red('90%')} -RAM: ${chalk.green('40%')} -DISK: ${chalk.yellow('70%')} -`); - -// ES2015 tagged template literal -log(chalk` -CPU: {red ${cpu.totalPercent}%} -RAM: {green ${ram.used / ram.total * 100}%} -DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} -`); - -// Use RGB colors in terminal emulators that support it. -log(chalk.keyword('orange')('Yay for orange colored text!')); -log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); -log(chalk.hex('#DEADED').bold('Bold gray!')); -``` - -Easily define your own themes: - -```js -const chalk = require('chalk'); - -const error = chalk.bold.red; -const warning = chalk.keyword('orange'); - -console.log(error('Error!')); -console.log(warning('Warning!')); -``` - -Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): - -```js -const name = 'Sindre'; -console.log(chalk.green('Hello %s'), name); -//=> 'Hello Sindre' -``` - - -## API - -### chalk.`