Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

yargs

Package Overview
Dependencies
Maintainers
2
Versions
250
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yargs - npm Package Compare versions

Comparing version 15.4.1 to 15.5.0-candidate.0

2

build/lib/validation.d.ts

@@ -26,3 +26,3 @@ import { Dictionary } from './common-types';

unfreeze(): void;
unknownArguments(argv: Arguments, aliases: DetailedArguments['aliases'], positionalMap: Dictionary, isDefaultCommand: boolean): void;
unknownArguments(argv: Arguments, aliases: DetailedArguments['aliases'], positionalMap: Dictionary, isDefaultCommand: boolean, checkPositionals?: boolean): void;
unknownCommands(argv: Arguments): boolean;

@@ -29,0 +29,0 @@ }

@@ -78,3 +78,3 @@ "use strict";

// check for unknown arguments (strict-mode).
self.unknownArguments = function unknownArguments(argv, aliases, positionalMap, isDefaultCommand) {
self.unknownArguments = function unknownArguments(argv, aliases, positionalMap, isDefaultCommand, checkPositionals = true) {
const commandKeys = yargs.getCommandInstance().getCommands();

@@ -91,3 +91,3 @@ const unknown = [];

});
if ((currentContext.commands.length > 0) || (commandKeys.length > 0) || isDefaultCommand) {
if (checkPositionals && ((currentContext.commands.length > 0) || (commandKeys.length > 0) || isDefaultCommand)) {
argv._.slice(currentContext.commands.length).forEach((key) => {

@@ -94,0 +94,0 @@ if (commandKeys.indexOf(key) === -1) {

@@ -117,2 +117,3 @@ /// <reference types="node" />

getStrictCommands(): boolean;
getStrictOptions(): boolean;
getUsageInstance(): UsageInstance;

@@ -171,2 +172,3 @@ getValidationInstance(): ValidationInstance;

strictCommands(enable?: boolean): YargsInstance;
strictOptions(enable?: boolean): YargsInstance;
string(key: string | string[]): YargsInstance;

@@ -173,0 +175,0 @@ terminalWidth(): number | null;

@@ -141,2 +141,3 @@ "use strict";

strictCommands,
strictOptions,
completionCommand,

@@ -170,2 +171,3 @@ output,

strictCommands,
strictOptions,
completionCommand,

@@ -777,2 +779,9 @@ parseFn,

self.getStrictCommands = () => strictCommands;
let strictOptions = false;
self.strictOptions = function (enabled) {
argsert_1.argsert('[boolean]', [enabled], arguments.length);
strictOptions = enabled !== false;
return self;
};
self.getStrictOptions = () => strictOptions;
let parserConfig = {};

@@ -1166,2 +1175,5 @@ self.parserConfiguration = function parserConfiguration(config) {

}
else if (strictOptions) {
validation.unknownArguments(argv, aliases, {}, false, false);
}
validation.customChecks(argv, aliases);

@@ -1168,0 +1180,0 @@ validation.limitedChoices(argv);

{
"name": "yargs",
"version": "15.4.1",
"version": "15.5.0-candidate.0",
"description": "yargs the modern, pirate-themed, successor to optimist.",

@@ -39,3 +39,3 @@ "main": "./index.js",

"@typescript-eslint/parser": "^3.0.0",
"c8": "^7.0.0",
"c8": "^6.0.1",
"chai": "^4.2.0",

@@ -42,0 +42,0 @@ "chalk": "^4.0.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc