@sasjs/adapter 3.10.6 → 3.10.9

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
@@ -87,5 +87,5 @@
87
87
  "https": "1.0.0",
88
88
  "tough-cookie": "4.0.0"
89
89
  },
90
- "version": "3.10.6"
90
+ "version": "3.10.9"
91
91
  }
@@ -28,7 +28,7 @@ export async function refreshTokensForSasjs(
28
28
  }
29
29
  })
30
30
  .catch((err) => {
31
- throw prefixMessage(err, 'Error while refreshing tokens')
31
+ throw prefixMessage(err, 'Error while refreshing tokens: ')
32
32
  })
33
33
 
34
34
  return authResponse
@@ -42,7 +42,7 @@ export async function refreshTokensForViya(
42
42
  )
43
43
  .then((res) => res.result)
44
44
  .catch((err) => {
45
- throw prefixMessage(err, 'Error while refreshing tokens')
45
+ throw prefixMessage(err, 'Error while refreshing tokens: ')
46
46
  })
47
47
 
48
48
  return authResponse
@@ -611,7 +611,10 @@ export const throwIfError = (response: AxiosResponse) => {
611
611
  throw new LoginRequiredError(response.data)
612
612
  }
613
613
 
614
- if (response.data.toLowerCase() === 'invalid csrf token!') {
614
+ if (
615
+ typeof response.data === 'string' &&
616
+ response.data.toLowerCase() === 'invalid csrf token!'
617
+ ) {
615
618
  throw new InvalidCsrfError()
616
619
  }
617
620
  break
@@ -141,7 +141,9 @@ export const convertToCSV = (
141
141
  )
142
142
  }
143
143
 
144
- return `.${value.toLowerCase()}`
144
+ const dot = value.includes('.') ? '' : '.'
145
+
146
+ return `${dot}${value.toLowerCase()}`
145
147
  }
146
148
 
147
149
  // if there any present, it should have preceding (") for escaping