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

djs-commander

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

djs-commander - npm Package Compare versions

Comparing version 0.0.38 to 0.0.39

6

CHANGELOG.md

@@ -7,2 +7,8 @@ # Change Log

## [0.0.39] - 2023-02-24
### Fixed
- Incomplete `commandObj` in validation files
## [0.0.38] - 2023-02-20

@@ -9,0 +15,0 @@

23

dist/index.d.ts

@@ -7,4 +7,3 @@ const { getFolderPaths, getFilePaths } = require('./utils/getPaths');

constructor({ client, commandsPath, eventsPath, validationsPath, testServer }) {
if (!client)
throw new Error('Property "client" is required when instantiating CommandHandler.');
if (!client) throw new Error('Property "client" is required when instantiating CommandHandler.');

@@ -45,5 +44,19 @@ this._client = client;

let commandsToRegister = JSON.parse(JSON.stringify(commands));
commandsToRegister.forEach((cmd) => {
delete cmd['deleted'];
delete cmd['run'];
let fieldsToSend = [
'name',
'options',
'name_localizations',
'description',
'description_localizations',
'default_permission',
'default_member_permissions',
'dm_permission',
];
commandsToRegister = commandsToRegister.map((cmd) => {
const filteredKeys = Object.keys(cmd).filter((key) => fieldsToSend.includes(key));
return filteredKeys.reduce((obj, key) => {
obj[key] = cmd[key];
return obj;
}, {});
});

@@ -50,0 +63,0 @@

@@ -73,3 +73,3 @@ var __defProp = Object.defineProperty;

for (const commandFilePath of commandFilePaths) {
const { data, run, deleted } = require(commandFilePath);
const { data, run, deleted, ...rest } = require(commandFilePath);
if (!data)

@@ -85,2 +85,3 @@ throw new Error(`File ${commandFilePath} must export "data".`);

...data,
...rest,
deleted: deleted || null,

@@ -224,5 +225,18 @@ run

let commandsToRegister = JSON.parse(JSON.stringify(commands));
commandsToRegister.forEach((cmd) => {
delete cmd["deleted"];
delete cmd["run"];
let fieldsToSend = [
"name",
"options",
"name_localizations",
"description",
"description_localizations",
"default_permission",
"default_member_permissions",
"dm_permission"
];
commandsToRegister = commandsToRegister.map((cmd) => {
const filteredKeys = Object.keys(cmd).filter((key) => fieldsToSend.includes(key));
return filteredKeys.reduce((obj, key) => {
obj[key] = cmd[key];
return obj;
}, {});
});

@@ -229,0 +243,0 @@ this._commandsToRegister = commandsToRegister;

{
"name": "djs-commander",
"version": "0.0.38",
"version": "0.0.39",
"description": "A command and event handler that works seemlessly with Discord.js",

@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts",

Sorry, the diff of this file is not supported yet

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