Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
fix docs for post
Browse files Browse the repository at this point in the history
  • Loading branch information
taylordowns2000 committed Jan 25, 2021
1 parent 90c2458 commit a725f45
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 40 deletions.
2 changes: 1 addition & 1 deletion lib/Adaptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ function get(path, params, callback) {
* @public
* @example
* post("/myendpoint", {
* @function
* body: {"foo": "bar"},
* headers: {"content-type": "application/json"},
* authentication: {username: "user", password: "pass"},
Expand All @@ -211,6 +210,7 @@ function get(path, params, callback) {
* return state;
* }
* )
* @function
* @param {string} path - Path to resource
* @param {object} params - Body, Query, Headers and Authentication parameters
* @param {function} callback - (Optional) Callback function
Expand Down
18 changes: 0 additions & 18 deletions lib/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ exports.setAuth = setAuth;
exports.assembleError = assembleError;
exports.tryJson = tryJson;
exports.mapToAxiosConfig = mapToAxiosConfig;
exports.recursivelyExpandReferences = recursivelyExpandReferences;

var _formData = _interopRequireDefault(require("form-data"));

Expand Down Expand Up @@ -115,20 +114,3 @@ function mapToAxiosConfig(requestConfig) {

};
}

function recursivelyExpandReferences(thing) {
return state => {
if (typeof thing !== 'object') return typeof thing == 'function' ? thing(state) : thing;
let result = (0, _fp.mapValues)(function (value) {
if (Array.isArray(value)) {
return value.map(item => {
return recursivelyExpandReferences(item)(state);
});
} else {
return recursivelyExpandReferences(value)(state);
}
})(thing);
if (Array.isArray(thing)) result = Object.values(result);
return result;
};
}
2 changes: 1 addition & 1 deletion src/Adaptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ export function get(path, params, callback) {
* @public
* @example
* post("/myendpoint", {
* @function
* body: {"foo": "bar"},
* headers: {"content-type": "application/json"},
* authentication: {username: "user", password: "pass"},
Expand All @@ -142,6 +141,7 @@ export function get(path, params, callback) {
* return state;
* }
* )
* @function
* @param {string} path - Path to resource
* @param {object} params - Body, Query, Headers and Authentication parameters
* @param {function} callback - (Optional) Callback function
Expand Down
22 changes: 2 additions & 20 deletions src/Utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import FormData from 'form-data';
import { mapValues, isEmpty } from 'lodash/fp';
import { isEmpty } from 'lodash/fp';

export function setUrl(configuration, path) {
if (configuration && configuration.baseUrl)
Expand Down Expand Up @@ -103,22 +103,4 @@ export function mapToAxiosConfig(requestConfig) {
// cancelToken,
// decompress,
};
}

export function recursivelyExpandReferences(thing) {
return state => {
if (typeof thing !== 'object')
return typeof thing == 'function' ? thing(state) : thing;
let result = mapValues(function (value) {
if (Array.isArray(value)) {
return value.map(item => {
return recursivelyExpandReferences(item)(state);
});
} else {
return recursivelyExpandReferences(value)(state);
}
})(thing);
if (Array.isArray(thing)) result = Object.values(result);
return result;
};
}
}

0 comments on commit a725f45

Please sign in to comment.