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
/** | |
* accepts a nested array of integers, | |
* returns a flat array of integers. | |
* does not check for null, floats, or random objects | |
* | |
* var input = [1, 2, null, {}, [3, 4, [5]], 6, 7]; | |
* console.log(flattenArray([])); | |
* | |
* @param a | |
* @returns {Array} |
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
var soap = require('soap'); // npm i soap | |
var url = 'fedex-api/RateService/RateService_v24.wsdl'; // you'll need to download the wsdl file from https://www.fedex.com/en-us/developer/web-services/process.html#StandardServices | |
// if you change the order of these variables, everything gets fucked up because "wsdl" is a format for developers who have | |
// landed themselves in a middle circle of hell. | |
// this points at fedex's production server btw. if you use dev credentials you'll need to change the url WAAAY down | |
// by the bottom of the file, in "client.setEndpoint('https://ws.fedex.com:443/web-services');" | |
var data = { | |
"WebAuthenticationDetail": { | |
"UserCredential": { |