@trenskow/request 1.0.2 → 1.0.3

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.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -6,7 +6,7 @@ import axios from 'axios';
6
6
  import merge from 'merge';
7
7
  import CustomPromise from '@trenskow/custom-promise';
8
8
  import streamReader from '@trenskow/stream-reader';
9
- import { isStream } from 'is-stream';
9
+ import { isReadableStream } from 'is-stream';
10
10
  import methods from 'methods';
11
11
  import caseit from '@trenskow/caseit';
12
12
  import ApiError from '@trenskow/api-error';
@@ -52,7 +52,7 @@ export default (baseUrl, options = {}) => {
52
52
  this._headerCasing = options.headerCasing || 'camel';
53
53
 
54
54
  if (typeof opt.payload !== 'undefined') {
55
- if (!Buffer.isBuffer(opt.payload) && !isStream.readable(opt.payload)) {
55
+ if (!Buffer.isBuffer(opt.payload) && !isReadableStream(opt.payload)) {
56
56
  this._headers['Content-Type'] = 'application/json; charset=utf-8';
57
57
  this._payload = Buffer.from(JSON.stringify(this._payload));
58
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trenskow/request",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A small request library for usage with APIs that uses the `@trenskow/api-error` package.",
5
5
  "main": "index.js",
6
6
  "scripts": {