Skip to content

Commit 5aec8c9

Browse files
committed
0.0.7
1 parent bdae733 commit 5aec8c9

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66

7+
## [0.0.7] - 2023-07-02
8+
9+
### Changed
10+
11+
- Give validation functions access to the full command object (commandObj) excluding the run function (as that is handled by the command handler), as opposed to just the `data` and `options` properties.
12+
713
## [0.0.6] - 2023-07-02
814

915
### Fixed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "commandkit",
3-
"version": "0.0.6",
3+
"version": "0.0.7",
44
"main": "dist/index.js",
55
"license": "MIT",
66
"scripts": {

src/handlers/command-handler/CommandHandler.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,12 @@ export class CommandHandler {
289289
// Run user validation functions
290290
const validationFunctions = this._data.validations;
291291

292+
const { data, options, run, ...rest } = targetCommand;
293+
292294
const commandObj = {
293295
data: targetCommand.data,
294296
options: targetCommand.options,
297+
...rest,
295298
};
296299

297300
let canRun = true;

0 commit comments

Comments
 (0)