1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-06-10 02:50:20 +00:00

Merge pull request #540 from sasjs/issue-532

fix: move SASjsRequest array from BaseJobExecutor class to RequestClient class
This commit is contained in:
Allan Bowe
2021-09-11 17:17:33 +03:00
committed by GitHub
11 changed files with 141 additions and 89 deletions
+2
View File
@@ -6,6 +6,8 @@ import { JsonParseArrayError, InvalidJsonError } from '../types/errors'
*/
export const getValidJson = (str: string | object) => {
try {
if (str === null || str === undefined) throw new InvalidJsonError()
if (Array.isArray(str)) throw new JsonParseArrayError()
if (typeof str === 'object') return str