paypal-isomorphic-functions
Advanced tools
Comparing version 1.0.17 to 1.0.18
@@ -6,3 +6,3 @@ "use strict"; | ||
async function createToken(token, data, headers) { | ||
const payload = Object.keys(data).length > 0 | ||
const payload = data && Object.keys(data).length > 0 | ||
? data | ||
@@ -9,0 +9,0 @@ : constants_1.DEFAULT_CREATE_BILLING_AGREEMENT_TOKEN_PAYLOAD; |
@@ -6,3 +6,3 @@ "use strict"; | ||
async function create(token, data, headers) { | ||
const payload = Object.keys(data).length > 0 ? data : constants_1.DEFAULT_CREATE_ORDER_PAYLOAD; | ||
const payload = data && Object.keys(data).length > 0 ? data : constants_1.DEFAULT_CREATE_ORDER_PAYLOAD; | ||
const options = { | ||
@@ -21,3 +21,3 @@ method: "POST", | ||
async function update(token, id, data, headers) { | ||
const payload = Object.keys(data).length > 0 ? data : constants_1.DEFAULT_UPDATE_ORDER_PAYLOAD; | ||
const payload = data && Object.keys(data).length > 0 ? data : constants_1.DEFAULT_UPDATE_ORDER_PAYLOAD; | ||
const options = { | ||
@@ -24,0 +24,0 @@ method: "PATCH", |
{ | ||
"name": "paypal-isomorphic-functions", | ||
"version": "1.0.17", | ||
"version": "1.0.18", | ||
"description": "Library of helpful paypal functions that can be run in a browser or server", | ||
@@ -10,3 +10,4 @@ "main": "./dist/index.js", | ||
"format": "prettier --write \"src/**/*.{json,ts,yml,md}\"", | ||
"release:quick": "npm run format && npm run build && git add -A && git commit -m 'Quick Release' && git push && npm version patch && npm publish" | ||
"release:quick": "npm run format && npm run build && git add -A && git commit -m 'Quick Release' && git push && npm version patch && npm publish", | ||
"quicktest": "ts-node -r dotenv/config test.ts" | ||
}, | ||
@@ -22,2 +23,3 @@ "author": "Andrew Throener", | ||
"ts-loader": "^6.2.1", | ||
"ts-node": "^9.1.1", | ||
"typescript": "^3.7.4", | ||
@@ -30,2 +32,3 @@ "webpack": "^4.41.2", | ||
"btoa": "^1.2.1", | ||
"dotenv": "^8.2.0", | ||
"es6-promise": "^4.2.8", | ||
@@ -32,0 +35,0 @@ "isomorphic-fetch": "^2.2.1", |
@@ -11,3 +11,3 @@ import { DEFAULT_CREATE_BILLING_AGREEMENT_TOKEN_PAYLOAD } from "./constants"; | ||
const payload = | ||
Object.keys(data).length > 0 | ||
data && Object.keys(data).length > 0 | ||
? data | ||
@@ -14,0 +14,0 @@ : DEFAULT_CREATE_BILLING_AGREEMENT_TOKEN_PAYLOAD; |
@@ -14,3 +14,3 @@ import { IPayPalAccessToken } from "../oauth/interfaces"; | ||
const payload = | ||
Object.keys(data).length > 0 ? data : DEFAULT_CREATE_ORDER_PAYLOAD; | ||
data && Object.keys(data).length > 0 ? data : DEFAULT_CREATE_ORDER_PAYLOAD; | ||
@@ -39,3 +39,3 @@ const options = { | ||
const payload = | ||
Object.keys(data).length > 0 ? data : DEFAULT_UPDATE_ORDER_PAYLOAD; | ||
data && Object.keys(data).length > 0 ? data : DEFAULT_UPDATE_ORDER_PAYLOAD; | ||
@@ -42,0 +42,0 @@ const options = { |
@@ -29,4 +29,5 @@ { | ||
"exclude": [ | ||
"src/**/*.test.ts" | ||
"src/**/*.test.ts", | ||
"./test.ts" | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
409421
96
1942
6
9
+ Addeddotenv@^8.2.0
+ Addeddotenv@8.6.0(transitive)