### File

`src/factory/answer-factory.ts`

### Index

###### Methods
Public create

### Methods

Public create
`create(answer: Answer | AnswerType)`
Defined in src/factory/answer-factory.ts:7
Parameters :
Name | Type | Optional | Description
answer | `Answer | AnswerType` |  |
Returns : `Answer<>`

    import { isNullOrUndefined } from 'util';

    import { Answer } from '../question';

    export class AnswerFactory {

      public static create<AnswerType>(answer: Answer<AnswerType> | AnswerType): Answer<AnswerType> {
        return !isNullOrUndefined(answer) && 'object' === typeof answer
          ? new Answer<AnswerType>(answer['value'], answer['id'])
          : new Answer<AnswerType>(answer);
      }
    }

# results matching ""

# No results matching ""