Set of static utility methods to assist with creating profile option names from profile types, constructing the root directory, reforming responses for different purposes, etc.

internal
export

### Hierarchy

- ProfileUtils

## Index

### Methods

- constructProfilesRootDirectory
- flattenDependencies
- getAllTypeNames
- getProfileMapKey
- getProfileOption
- getProfileOptionAlias
- getProfileOptionAndAlias
- getProfilePropertyKey

## Methods

### Static constructProfilesRootDirectory

- constructProfilesRootDirectory(home: string): string

- - Defined in @zowe/imperative/src/profiles/src/utils/ProfileUtils.ts:33

  Construct the profiles root directory, given the "home" directory.

  static
  memberof

    ProfileUtils

  #### Parameters

  - ##### home: string

    The home directory - normally supplied by Imperative.

  #### Returns string

  - The profiles root directory

### Static flattenDependencies

- flattenDependencies(dependencyResponses: IProfileLoaded[]): IProfileLoaded[]

- - Defined in @zowe/imperative/src/profiles/src/utils/ProfileUtils.ts:46

  Accepts an array of responses, which, depending on the depedencies, may have nested depedency arrays, and flattens to a single level (for ease of printing, etc.).

  static
  memberof

    ProfileUtils

  #### Parameters

  - ##### dependencyResponses: IProfileLoaded[]

    The list of load responses

  #### Returns IProfileLoaded[]

  - The list of load responses flattened to a single level

### Static getAllTypeNames

- getAllTypeNames(profileConfigs: IProfileTypeConfiguration[]): string[]

- - Defined in @zowe/imperative/src/profiles/src/utils/ProfileUtils.ts:70

  Accepts the profile configuration document and returns an array of all types.

  static
  memberof

    ProfileUtils

  #### Parameters

  - ##### profileConfigs: IProfileTypeConfiguration[]

    All profile type configuration documents.

  #### Returns string[]

  - An array of profile types.

### Static getProfileMapKey

- getProfileMapKey(type: string, name: string): string

- - Defined in @zowe/imperative/src/profiles/src/utils/ProfileUtils.ts:111

  Create a mapKey value to identify a profile

  #### Parameters

  - ##### type: string

    Type of the profile

  - ##### name: string

    Name of the profile

  #### Returns string

  - Key identifying the profile

### Static getProfileOption

- getProfileOption(type: string): string

- - Defined in @zowe/imperative/src/profiles/src/utils/ProfileUtils.ts:82

  Construct the profile option - e.g banana-profile - Used to append to commands automatically and by the command processor to check if profile options are present.

  #### Parameters

  - ##### type: string

  #### Returns string

  - The full option name

### Static getProfileOptionAlias

- getProfileOptionAlias(type: string): string

- - Defined in @zowe/imperative/src/profiles/src/utils/ProfileUtils.ts:92

  Construct the profile option alias - e.g banana-p- Used to append to commands automatically and by the command processor to check if profile options are present.

  #### Parameters

  - ##### type: string

  #### Returns string

  - The alias for the profile option

### Static getProfileOptionAndAlias

- getProfileOptionAndAlias(type: string): [string, string]

- - Defined in @zowe/imperative/src/profiles/src/utils/ProfileUtils.ts:101

  Returns the standard profile option name like "banana-profile" and its alias

  #### Parameters

  - ##### type: string

  #### Returns [string, string]

  : The option and its alias

### Static getProfilePropertyKey

- getProfilePropertyKey(type: string, name: string, field: string): string

- - Defined in @zowe/imperative/src/profiles/src/utils/ProfileUtils.ts:122

  Create a key value to identify a property on a profile

  #### Parameters

  - ##### type: string

    Type of the profile

  - ##### name: string

    Name of the profile

  - ##### field: string

  #### Returns string

  - Key identifying the profile

Generated using TypeDoc