asma-core-helpers 0.4.0 → 0.4.1
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.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Buffer } from 'buffer'
|
|
2
2
|
export function fromBase64ToJSON<T>(base64: string): T {
|
|
3
3
|
const json_str = Buffer.from(base64, 'base64').toString('utf-8')
|
|
4
|
-
return JSON.parse(json_str)
|
|
4
|
+
return JSON.parse(json_str) as T
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export function fromJSONToBase64<T>(json: T): string {
|
|
@@ -18,10 +18,10 @@ export function _getServerErrorMessage(error: Record<string, any> | string): str
|
|
|
18
18
|
return error['data']['Message']
|
|
19
19
|
}
|
|
20
20
|
if (Array.isArray(error)) {
|
|
21
|
-
return _getArrayErrorsMessage(error)
|
|
21
|
+
return _getArrayErrorsMessage(error as Record<string, unknown>[])
|
|
22
22
|
}
|
|
23
23
|
if (Array.isArray(error?.['errors'])) {
|
|
24
|
-
return _getArrayErrorsMessage(error['errors'])
|
|
24
|
+
return _getArrayErrorsMessage(error['errors'] as Record<string, unknown>[])
|
|
25
25
|
}
|
|
26
26
|
//graphql
|
|
27
27
|
else if (error['bodyText']) {
|
package/src/utility/fetch.ts
CHANGED