# utils | @sasjs/adapter

# Module utils

### Functions

- asyncForEach
- compareTimestamps
- convertToCSV
- formatDataForRequest
- isAuthorizeFormRequired
- isIEorEdgeOrOldFirefox
- isLogInRequired
- isLogInSuccess
- isRelativePath
- isUri
- isUrl
- makeRequest
- needsRetry
- parseAndSubmitAuthorizeForm
- parseGeneratedCode
- parseSasViyaLog
- parseSourceCode
- parseWeboutResponse
- serialize
- splitChunks

## Functions

### asyncForEach

- asyncForEach(array: any[], callback: any): Promise<void>

- - Defined in utils/asyncForEach.ts:1

  #### Parameters

  - ##### array: any[]

  - ##### callback: any

  #### Returns Promise<void>

### Const compareTimestamps

- compareTimestamps(a: SASjsRequest, b: SASjsRequest ): number

- - Defined in utils/compareTimestamps.ts:7

  Comparator for SASjs request timestamps.

  #### Parameters

  - ##### a: SASjsRequest

  - ##### b: SASjsRequest

  #### Returns number

### Const convertToCSV

- convertToCSV(data: any): string

- - Defined in utils/convertToCsv.ts:5

  Converts the given JSON object to a CSV string.

  #### Parameters

  - ##### data: any

    the JSON object to convert.

  #### Returns string

### Const formatDataForRequest

- formatDataForRequest(data: any): any

- - Defined in utils/formatDataForRequest.ts:4

  #### Parameters

  - ##### data: any

  #### Returns any

### Const isAuthorizeFormRequired

- isAuthorizeFormRequired(response: string): boolean

- - Defined in utils/isAuthorizeFormRequired.ts:1

  #### Parameters

  - ##### response: string

  #### Returns boolean

### isIEorEdgeOrOldFirefox

- isIEorEdgeOrOldFirefox(): boolean

- - Defined in utils/isIeOrEdge.ts:1

  #### Returns boolean

### Const isLogInRequired

- isLogInRequired(response: string): boolean

- - Defined in utils/isLoginRequired.ts:1

  #### Parameters

  - ##### response: string

  #### Returns boolean

### Const isLogInSuccess

- isLogInSuccess(response: string): boolean

- - Defined in utils/isLoginSuccess.ts:1

  #### Parameters

  - ##### response: string

  #### Returns boolean

### Const isRelativePath

- isRelativePath(uri: string): boolean

- - Defined in utils/isRelativePath.ts:1

  #### Parameters

  - ##### uri: string

  #### Returns boolean

### Const isUri

- isUri(str: string): boolean

- - Defined in utils/isUri.ts:5

  Checks if string is in URI format.

  #### Parameters

  - ##### str: string

    string to check.

  #### Returns boolean

### Const isUrl

- isUrl(url: string): boolean

- - Defined in utils/isUrl.ts:5

  Checks if string is in URL format.

  #### Parameters

  - ##### url: string

    string to check.

  #### Returns boolean

### makeRequest

- makeRequest<T>(url: string, request: RequestInit, callback: function, contentType?: "text" | "json"): Promise<object>

- - Defined in utils/makeRequest.ts:7

  #### Type parameters

  - #### T

  #### Parameters

  - ##### url: string

  - ##### request: RequestInit

  - ##### callback: function

    - - (value: CsrfToken ): any

      - #### Parameters

        - ##### value: CsrfToken

        #### Returns any

  - ##### Default value contentType: "text" | "json" = "json"

  #### Returns Promise<object>

### Const needsRetry

- needsRetry(responseText: string): boolean

- - Defined in utils/needsRetry.ts:1

  #### Parameters

  - ##### responseText: string

  #### Returns boolean

### Const parseAndSubmitAuthorizeForm

- parseAndSubmitAuthorizeForm(response: string, serverUrl: string): Promise<unknown>

- - Defined in utils/parseAndSubmitAuthorizeForm.ts:1

  #### Parameters

  - ##### response: string

  - ##### serverUrl: string

  #### Returns Promise<unknown>

### Const parseGeneratedCode

- parseGeneratedCode(log: string): string

- - Defined in utils/parseGeneratedCode.ts:1

  #### Parameters

  - ##### log: string

  #### Returns string

### Const parseSasViyaLog

- parseSasViyaLog(logResponse: object): string | object

- - Defined in utils/parseSasViyaLog.ts:1

  #### Parameters

  - ##### logResponse: object

    - ##### items: any[]

  #### Returns string | object

### Const parseSourceCode

- parseSourceCode(log: string): string

- - Defined in utils/parseSourceCode.ts:1

  #### Parameters

  - ##### log: string

  #### Returns string

### Const parseWeboutResponse

- parseWeboutResponse(response: string): string

- - Defined in utils/parseWeboutResponse.ts:1

  #### Parameters

  - ##### response: string

  #### Returns string

### Const serialize

- serialize(obj: any): string

- - Defined in utils/serialize.ts:1

  #### Parameters

  - ##### obj: any

  #### Returns string

### Const splitChunks

- splitChunks(content: string): any[]

- - Defined in utils/splitChunks.ts:1

  #### Parameters

  - ##### content: string

  #### Returns any[]

Generated using TypeDoc