bob-core 0.9.8 → 0.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ import { BobError } from "./BobError";
2
+ export type BadParameterProps = {
3
+ option: string;
4
+ value?: string;
5
+ reason?: string;
6
+ };
7
+ export declare class BadCommandOption extends BobError {
8
+ readonly param: BadParameterProps;
9
+ constructor(param: BadParameterProps);
10
+ pretty(): void;
11
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.BadCommandOption = void 0;
7
+ const BobError_1 = require("./BobError");
8
+ const chalk_1 = __importDefault(require("chalk"));
9
+ class BadCommandOption extends BobError_1.BobError {
10
+ param;
11
+ constructor(param) {
12
+ let message = `Option "${param.option}" value is invalid.`;
13
+ if (param.reason) {
14
+ message += ` Reason: ${param.reason}`;
15
+ }
16
+ else {
17
+ message += ` Value: "${param.value}"`;
18
+ }
19
+ super(message);
20
+ this.param = param;
21
+ }
22
+ pretty() {
23
+ const log = console.log;
24
+ log((0, chalk_1.default) ` {white.bgRed ERROR } Option {bold.yellow ${this.param.option}} value is invalid. `);
25
+ if (this.param.value || this.param.reason) {
26
+ log('');
27
+ }
28
+ if (this.param.value) {
29
+ log((0, chalk_1.default) ` {blue Value}: ${this.param.value}`);
30
+ }
31
+ if (this.param.reason) {
32
+ log((0, chalk_1.default) ` {yellow Reason}: ${this.param.reason}`);
33
+ }
34
+ }
35
+ }
36
+ exports.BadCommandOption = BadCommandOption;
@@ -0,0 +1,11 @@
1
+ import { BobError } from "./BobError";
2
+ export type BadParameterProps = {
3
+ param: string;
4
+ value?: string;
5
+ reason?: string;
6
+ };
7
+ export declare class BadCommandParameter extends BobError {
8
+ readonly param: BadParameterProps;
9
+ constructor(param: BadParameterProps);
10
+ pretty(): void;
11
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.BadCommandParameter = void 0;
7
+ const BobError_1 = require("./BobError");
8
+ const chalk_1 = __importDefault(require("chalk"));
9
+ class BadCommandParameter extends BobError_1.BobError {
10
+ param;
11
+ constructor(param) {
12
+ let message = `Argument "${param.param}" value is invalid.`;
13
+ if (param.reason) {
14
+ message += ` Reason: ${param.reason}`;
15
+ }
16
+ else {
17
+ message += ` Value: "${param.value}"`;
18
+ }
19
+ super(message);
20
+ this.param = param;
21
+ }
22
+ pretty() {
23
+ const log = console.log;
24
+ log((0, chalk_1.default) ` {white.bgRed ERROR } Argument {bold.yellow ${this.param.param}} value is invalid. `);
25
+ if (this.param.value || this.param.reason) {
26
+ log('');
27
+ }
28
+ if (this.param.value) {
29
+ log((0, chalk_1.default) ` {blue Value}: ${this.param.value}`);
30
+ }
31
+ if (this.param.reason) {
32
+ log((0, chalk_1.default) ` {yellow Reason}: ${this.param.reason}`);
33
+ }
34
+ }
35
+ }
36
+ exports.BadCommandParameter = BadCommandParameter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bob-core",
3
- "version": "0.9.8",
3
+ "version": "0.9.9",
4
4
  "description": "BOB Core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",