New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cli-flags

Package Overview
Dependencies
Maintainers
3
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-flags - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

lib/list.d.ts

6

lib/deps.d.ts

@@ -5,2 +5,3 @@ import args = require('./args');

import validate = require('./validate');
import errors = require('./errors');
import chalk = require('chalk');

@@ -12,3 +13,8 @@ export declare const deps: {

readonly validate: typeof validate;
readonly screen: {
readonly errtermwidth: number;
readonly stdtermwidth: number;
};
readonly renderList: (items: [string, string | undefined][]) => string;
readonly errors: typeof errors;
readonly chalk: (chalk.Chalk & {

@@ -15,0 +21,0 @@ supportsColor: chalk.ColorSupport;

4

lib/deps.js

@@ -8,3 +8,5 @@ "use strict";

get validate() { return fetch('./validate'); },
get renderList() { return fetch('cli-ux/lib/list').renderList; },
get screen() { return fetch('./screen').default; },
get renderList() { return fetch('./list').renderList; },
get errors() { return fetch('./errors'); },
get chalk() {

@@ -11,0 +13,0 @@ try {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const list_1 = require("cli-ux/lib/list");
const deps_1 = require("./deps");
const help_1 = require("./help");

@@ -18,3 +18,3 @@ class CLIParseError extends Error {

if (namedArgs.length) {
const list = list_1.renderList(namedArgs.map(a => [a.name, a.description]));
const list = deps_1.deps.renderList(namedArgs.map(a => [a.name, a.description]));
message += `:\n${list}`;

@@ -29,3 +29,3 @@ }

constructor({ flags, parse }) {
const usage = list_1.renderList(help_1.flagUsages(flags, { displayRequired: false }));
const usage = deps_1.deps.renderList(help_1.flagUsages(flags, { displayRequired: false }));
const message = `Missing required flag${flags.length === 1 ? '' : 's'}:\n${usage}`;

@@ -32,0 +32,0 @@ super({ parse, message });

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const deps_1 = require("./deps");
const ts_lodash_1 = require("ts-lodash");
function dim(s) {

@@ -27,5 +26,6 @@ if (deps_1.deps.chalk)

return [];
flags = ts_lodash_1.default.sortBy(flags, f => [!f.char, f.char, f.name]);
const _ = require('ts-lodash').default;
flags = _.sortBy(flags, f => [!f.char, f.char, f.name]);
return flags.map(f => flagUsage(f, options));
}
exports.flagUsages = flagUsages;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ts_lodash_1 = require("ts-lodash");
let debug;

@@ -17,3 +16,4 @@ try {

this._setNames();
this.booleanFlags = ts_lodash_1.default.pickBy(input.flags, (f) => f.type === 'boolean');
const _ = require('ts-lodash').default;
this.booleanFlags = _.pickBy(input.flags, (f) => f.type === 'boolean');
}

@@ -20,0 +20,0 @@ parse() {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const errors_1 = require("./errors");
const deps_1 = require("./deps");
function validate(parse) {

@@ -9,3 +9,3 @@ function validateArgs() {

const extras = parse.output.argv.slice(maxArgs);
throw new errors_1.UnexpectedArgsError({ parse, args: extras });
throw new deps_1.deps.errors.UnexpectedArgsError({ parse, args: extras });
}

@@ -15,3 +15,3 @@ const requiredArgs = parse.input.args.filter(a => a.required);

if (missingRequiredArgs.length) {
throw new errors_1.RequiredArgsError({ parse, args: missingRequiredArgs });
throw new deps_1.deps.errors.RequiredArgsError({ parse, args: missingRequiredArgs });
}

@@ -22,3 +22,3 @@ }

if (flags.length)
throw new errors_1.RequiredFlagError({ parse, flags });
throw new deps_1.deps.errors.RequiredFlagError({ parse, flags });
}

@@ -25,0 +25,0 @@ validateArgs();

{
"name": "cli-flags",
"description": "basic CLI flag parser",
"version": "2.0.2",
"version": "2.0.3",
"author": "Jeff Dickey",
"bugs": "https://github.com/heroku/cli-flags/issues",
"dependencies": {
"cli-ux": "^2.0.10",
"@heroku/linewrap": "^1.0.0",
"ts-lodash": "^4.0.8"

@@ -13,5 +13,5 @@ },

"@types/chalk": "2.2.0",
"@types/jest": "^21.1.8",
"@types/jest": "^21.1.9",
"@types/lodash": "^4.14.91",
"@types/node": "^8.5.1",
"@types/node": "^8.5.2",
"babel-core": "^6.26.0",

@@ -21,3 +21,3 @@ "chalk": "^2.3.0",

"husky": "^0.14.3",
"jest": "^22.0.3",
"jest": "^22.0.4",
"lint-staged": "^6.0.0",

@@ -24,0 +24,0 @@ "prettier": "^1.9.2",

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