bob-core 0.9.9 → 0.9.11

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.
@@ -69,6 +69,10 @@ class CommandParser {
69
69
  this.defaultOptions = defaultOptions;
70
70
  const [command, ...signatureParams] = signature.split(/\{(.*?)\}/g).map(param => param.trim()).filter(Boolean);
71
71
  const { _: paramValues, ...optionValues } = (0, minimist_1.default)(args);
72
+ this.command = command;
73
+ this.parseSignature(signatureParams);
74
+ this.parseArguments(paramValues);
75
+ this.parseOptions(optionValues);
72
76
  if (defaultOptions.length) {
73
77
  for (const option of defaultOptions) {
74
78
  this.optionSignatures[option.name] = option;
@@ -80,10 +84,6 @@ class CommandParser {
80
84
  }
81
85
  }
82
86
  }
83
- this.command = command;
84
- this.parseSignature(signatureParams);
85
- this.parseArguments(paramValues);
86
- this.parseOptions(optionValues);
87
87
  }
88
88
  getParamValue(value, signature) {
89
89
  if (signature.type === 'boolean') {
@@ -1,11 +1,11 @@
1
1
  import { BobError } from "./BobError";
2
- export type BadParameterProps = {
2
+ export type OptionProps = {
3
3
  option: string;
4
4
  value?: string;
5
5
  reason?: string;
6
6
  };
7
7
  export declare class BadCommandOption extends BobError {
8
- readonly param: BadParameterProps;
9
- constructor(param: BadParameterProps);
8
+ readonly param: OptionProps;
9
+ constructor(param: OptionProps);
10
10
  pretty(): void;
11
11
  }
@@ -1,11 +1,11 @@
1
1
  import { BobError } from "./BobError";
2
- export type BadParameterProps = {
2
+ export type ParameterProps = {
3
3
  param: string;
4
4
  value?: string;
5
5
  reason?: string;
6
6
  };
7
7
  export declare class BadCommandParameter extends BobError {
8
- readonly param: BadParameterProps;
9
- constructor(param: BadParameterProps);
8
+ readonly param: ParameterProps;
9
+ constructor(param: ParameterProps);
10
10
  pretty(): void;
11
11
  }
@@ -0,0 +1,3 @@
1
+ export * from './BobError';
2
+ export * from './BadCommandParameter';
3
+ export * from './BadCommandOption';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./BobError"), exports);
18
+ __exportStar(require("./BadCommandParameter"), exports);
19
+ __exportStar(require("./BadCommandOption"), exports);
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './Command';
2
2
  export * from './Cli';
3
+ export * from './errors';
package/dist/index.js CHANGED
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Command"), exports);
18
18
  __exportStar(require("./Cli"), exports);
19
+ __exportStar(require("./errors"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bob-core",
3
- "version": "0.9.9",
3
+ "version": "0.9.11",
4
4
  "description": "BOB Core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",