-
Notifications
You must be signed in to change notification settings - Fork 6
Introduce custom header agent + bump version of generator #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding some sensible defaults from the template.
@@ -1,25 +1,26 @@ | |||
{ | |||
"name": "@patch-technology/patch", | |||
"version": "1.9.0", | |||
"description": "JavaScript wrapper for the Patch API", | |||
"version": "1.10.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the description and version are now automatically generated from the generator config.
"scripts": { | ||
"build": "babel src -d dist", | ||
"prepare": "npm run build", | ||
"test": "mocha" | ||
}, | ||
"browser": { | ||
"fs": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that package.json is no longer defined on this repo but in the templates.
this.defaultHeaders = { | ||
'User-Agent': 'patch-node/1.10.0' | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a default User-Agent
header.
static canBeJsonified(str) { | ||
if (typeof str !== 'string' && typeof str !== 'object') return false; | ||
try { | ||
const type = str.toString(); | ||
return type === '[object Object]' || type === '[object Array]'; | ||
} catch (err) { | ||
return false; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those were added by more recent versions of the template.
@kleinjm I however left your parsing changes (so this isn't used) as replacing with this was breaking the metadata feature.
this.createBitcoinEstimate = this.createBitcoinEstimate.bind(this); | ||
this.createBitcoinEstimateWithHttpInfo = | ||
this.createBitcoinEstimateWithHttpInfo.bind(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was surprising (unclear why needed), and not in the most recent template.
What
Pairs with https://github.com/patch-technology/client-code-generation/pull/31
Why
SDK Release Checklist