@graphql-inspector/commands
Advanced tools
Comparing version 2.0.0-rc.1 to 2.0.0-rc.2
@@ -24,2 +24,15 @@ 'use strict'; | ||
} | ||
function parseGlobalArgs(args) { | ||
const headers = {}; | ||
if (args.header) { | ||
args.header.forEach((header) => { | ||
const [name, ...values] = header.split(':'); | ||
headers[name] = values.join(''); | ||
}); | ||
} | ||
if (args.require) { | ||
args.require.forEach((mod) => require(mod)); | ||
} | ||
return { headers, token: args.token }; | ||
} | ||
function mockCommand(mod, cmd) { | ||
@@ -43,3 +56,4 @@ return tslib.__awaiter(this, void 0, void 0, function* () { | ||
exports.mockCommand = mockCommand; | ||
exports.parseGlobalArgs = parseGlobalArgs; | ||
exports.useCommands = useCommands; | ||
//# sourceMappingURL=index.cjs.js.map |
@@ -16,4 +16,8 @@ import { InspectorConfig } from '@graphql-inspector/config'; | ||
token?: string; | ||
headers?: string[]; | ||
header?: string[]; | ||
} | ||
export declare function parseGlobalArgs(args: GlobalArgs): { | ||
headers: Record<string, string>; | ||
token: string | undefined; | ||
}; | ||
export declare function mockCommand(mod: CommandModule, cmd: string): Promise<string>; |
@@ -18,2 +18,15 @@ import { __awaiter } from 'tslib'; | ||
} | ||
function parseGlobalArgs(args) { | ||
const headers = {}; | ||
if (args.header) { | ||
args.header.forEach((header) => { | ||
const [name, ...values] = header.split(':'); | ||
headers[name] = values.join(''); | ||
}); | ||
} | ||
if (args.require) { | ||
args.require.forEach((mod) => require(mod)); | ||
} | ||
return { headers, token: args.token }; | ||
} | ||
function mockCommand(mod, cmd) { | ||
@@ -34,3 +47,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
export { createCommand, ensureAbsolute, mockCommand, useCommands }; | ||
export { createCommand, ensureAbsolute, mockCommand, parseGlobalArgs, useCommands }; | ||
//# sourceMappingURL=index.esm.js.map |
{ | ||
"name": "@graphql-inspector/commands", | ||
"version": "2.0.0-rc.1", | ||
"version": "2.0.0-rc.2", | ||
"description": "Plugin system for commands in GraphQL Inspector", | ||
"peerDependencies": { | ||
"@graphql-inspector/config": "2.0.0-rc.1", | ||
"@graphql-inspector/loaders": "2.0.0-rc.1", | ||
"@graphql-inspector/config": "2.0.0-rc.2", | ||
"@graphql-inspector/loaders": "2.0.0-rc.2", | ||
"graphql": "^0.13.0 || ^14.0.0 || ^15.0.0", | ||
@@ -9,0 +9,0 @@ "yargs": "15.3.1" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11358
119
4