@tstdl/base 0.92.165 → 0.92.167

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.
@@ -7,7 +7,7 @@ export async function contentTypeMiddleware(context, next) {
7
7
  return;
8
8
  }
9
9
  response.headers.contentType = match(response.body)
10
- .with({ json: P.select(P.nonNullable) }, () => 'application/json; charset=utf-8')
10
+ .with({ json: P.select(P.when(isDefined)) }, () => 'application/json; charset=utf-8')
11
11
  .with({ text: P.select(P.nonNullable) }, () => 'text/plain; charset=utf-8')
12
12
  .with({ buffer: P.select(P.nonNullable) }, () => 'application/octet-stream')
13
13
  .with({ stream: P.select(P.nonNullable) }, () => 'application/octet-stream')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.92.165",
3
+ "version": "0.92.167",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -188,7 +188,8 @@ export const assertArrayBuffer = arrayBufferGuards.assertArrayBuffer;
188
188
  export const assertNotArrayBuffer = arrayBufferGuards.assertNotArrayBuffer;
189
189
  export const assertArrayBufferPass = arrayBufferGuards.assertArrayBufferPass;
190
190
  export const assertNotArrayBufferPass = arrayBufferGuards.assertNotArrayBufferPass;
191
- const sharedArrayBufferGuards = createInstanceGuards('SharedArrayBuffer', SharedArrayBuffer);
191
+ const sharedArrayBufferGuards = createInstanceGuards('SharedArrayBuffer', globalThis.SharedArrayBuffer ?? class MockSharedArrayBuffer {
192
+ }); // in case SharedArrayBuffer is not available
192
193
  export const isSharedArrayBuffer = sharedArrayBufferGuards.isSharedArrayBuffer;
193
194
  export const isNotSharedArrayBuffer = sharedArrayBufferGuards.isNotSharedArrayBuffer;
194
195
  export const assertSharedArrayBuffer = sharedArrayBufferGuards.assertSharedArrayBuffer;