# Module: constant

Contains all of the constant system commands.

Author:
  - Seth Hollingsead
Copyright:
  - Copyright © 2022-… by Seth Hollingsead. All rights reserved
Source:
  - commandsBlob/commands/constant.js, line 1

### Requires

- module:ruleBroker
- module:configurator
- module:loggers
- module:queue
- module:stack
- @haystacks/constants
- path

### Methods

#### (inner) constantsGenerator(inputData, inputMetaData) → {array.<boolean, (string|integer|boolean|object|array)>}

Requests a string input the user would like to have converted nto a constant, while determining the most optimized way to define the new constant based on existing constants. Also checks to see if that new constant is already defined in the constants system.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | Parameterized constant to generate for.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/constant.js, line 32

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by the command output.

Type
  array.<boolean, (string|integer|boolean|object|array)>

#### (inner) constantsGeneratorList(inputData, inputMetaData) → {array.<boolean, (string|integer|boolean|object|array)>}

Calls the constantsGenerator command to iterate over a list of constants and generate many constants sequentially.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | Parameterized coma delimited list of constants to be auto-generated
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/constant.js, line 119

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by the command output.

Type
  array.<boolean, (string|integer|boolean|object|array)>

#### (inner) constantsPatternRecognizer(inputData, inputMetaData) → {array.<boolean, (string|integer|boolean|object|array)>}

Walks through a list of constants looking for patterns internal to the strings.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | Parameterized coma delimited list of constants to be passed through pattern recognition to find common strings among them.
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/constant.js, line 208

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by the command output.

Type
  array.<boolean, (string|integer|boolean|object|array)>

#### (inner) evaluateConstant(inputData, inputMetaData) → {array.<boolean, (string|integer|boolean|object|array)>}

Resolves a constant and prints the output of the constant value.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<string> | A string array that contains the name of the constant that should be resolved and printed. inputData[0] = evaluateConstant inputData[1] = constantToBeEvaluated - The constant that should be resolved and printed to the output if it exists.
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/constant.js, line 288

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by the command output.

Type
  array.<boolean, (string|integer|boolean|object|array)>