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

@oclif/plugin-commands

Package Overview
Dependencies
Maintainers
0
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oclif/plugin-commands - npm Package Compare versions

Comparing version 4.0.16 to 4.0.17

17

lib/commands/commands.js

@@ -34,2 +34,8 @@ import { Command, Flags, toConfiguredId } from '@oclif/core';

}
// In order to collect static properties up the inheritance chain, we need to recursively access the prototypes until there's nothing left
function mergePrototype(result, command) {
const proto = Object.getPrototypeOf(command);
const filteredProto = _.pickBy(proto, (v) => v !== undefined);
return Object.keys(proto).length > 0 ? mergePrototype({ ...filteredProto, ...result }, proto) : result;
}
export default class Commands extends Command {

@@ -118,12 +124,5 @@ static description = 'List all <%= config.bin %> commands.';

this.debug(error);
return cmd;
}
const obj = { ...cmd, ...commandClass };
// Load all properties on all extending classes.
while (commandClass !== undefined) {
commandClass = Object.getPrototypeOf(commandClass) ?? undefined;
// ES2022 will return all unset static properties on the prototype as undefined. This is different from ES2021
// which only returns the static properties that are set by defaults. In order to prevent
// Object.assign from overwriting the properties on the object, we need to filter out the undefined values.
Object.assign(obj, _.pickBy(commandClass, (v) => v !== undefined));
}
const obj = { ...mergePrototype(commandClass, commandClass), ...cmd };
// The plugin property on the loaded class contains a LOT of information including all the commands again. Remove it.

@@ -130,0 +129,0 @@ delete obj.plugin;

@@ -108,3 +108,3 @@ {

},
"version": "4.0.16"
"version": "4.0.17"
}
{
"name": "@oclif/plugin-commands",
"description": "plugin to show the list of all the commands",
"version": "4.0.16",
"version": "4.0.17",
"author": "Salesforce",

@@ -33,3 +33,3 @@ "bugs": "https://github.com/oclif/plugin-commands/issues",

"nyc": "^15.1.0",
"oclif": "^4.14.34",
"oclif": "^4.14.35",
"prettier": "^3.3.3",

@@ -36,0 +36,0 @@ "shx": "^0.3.3",

@@ -24,3 +24,3 @@ # @oclif/plugin-commands

$ oclif-example (--version)
@oclif/plugin-commands/4.0.16 linux-x64 node-v20.17.0
@oclif/plugin-commands/4.0.17 linux-x64 node-v20.17.0
$ oclif-example --help [COMMAND]

@@ -65,3 +65,3 @@ USAGE

_See code: [src/commands/commands.ts](https://github.com/oclif/plugin-commands/blob/v4.0.16/src/commands/commands.ts)_
_See code: [src/commands/commands.ts](https://github.com/oclif/plugin-commands/blob/v4.0.17/src/commands/commands.ts)_
<!-- commandsstop -->

@@ -68,0 +68,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