This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function mapValues(obj, fn) { | |
| return Object.keys(obj).reduce((result, key) => { | |
| result[key] = fn(obj[key], key); | |
| return result; | |
| }, {}); | |
| } | |
| function pick(obj, fn) { | |
| return Object.keys(obj).reduce((result, key) => { | |
| if (fn(obj[key])) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * send API request to the proxy | |
| * @param {Object} options for the request | |
| * @param {String} options.url the full API request URL | |
| * @param {String="GET","POST","PATCH","PUT","DELETE"} requestData [options.requestType="GET"] HTTP type for the request | |
| * @param {String} options.proxyURL proxyURL to send the request to | |
| * @param {String} options.client_id client id for the account (default is in the proxy) | |
| * @param {String} options.client_secret client secret for the account (default is in the proxy) | |
| * @param {JSON} [options.requestBody] Data to be sent in the request body in the form of a JSON string | |
| * @param {Function} [callback] callback function that will process the response |