Skip to content

Commit 6900e94

Browse files
committed
Add v1.0.3 to changelog, linting
1 parent 767983b commit 6900e94

4 files changed

Lines changed: 14 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CHANGELOG
22

3+
## v1.0.3 - 2020-07-17
4+
- Adds better CLI support for POSTing things
5+
6+
## v1.0.2 - 2020-07-17
7+
- Deprecated.
8+
39
## v1.0.1 - 2020-05-06
410
- Dependency updates to address vulnerabilities
511

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,9 @@ nypl-data-api schema post [name] [jsonfile]
119119

120120
1. Cut feature branch from `master`
121121
2. After review, merge to `master`
122-
3. Bump version in `package.json` and `git tag -a v[version]`
123-
4. `npm publish`
122+
3. Bump version in `package.json` & note changes in `CHANGELOG.md`
123+
4. `git tag -a v[version]`
124+
5. `npm publish`
124125

125126
## Testing
126127

bin/nypl-data-api.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ const log_level = argv.log_level || 'error'
1515
var client = new DataApiClient({ log_level })
1616

1717
var doPost = function (path, content) {
18-
19-
if ((typeof content) != 'object') {
18+
if ((typeof content) !== 'object') {
2019
content = JSON.parse(content)
2120
}
2221

@@ -37,7 +36,7 @@ var doGet = function (path) {
3736
let formattedResponse = resp
3837
if (typeof resp !== 'string') {
3938
// If JSON, format as json, otherwise print as-is:
40-
try { Object.keys(resp).length >= 1 && (formattedResponse = JSON.stringify(resp, null, 2)) } catch(e) { }
39+
try { Object.keys(resp).length >= 1 && (formattedResponse = JSON.stringify(resp, null, 2)) } catch (e) { }
4140
}
4241
console.log('Got response: \n', formattedResponse)
4342
}).catch((e) => {
@@ -68,9 +67,8 @@ function promptToPost (path, content) {
6867

6968
try {
7069
// Assume all posted bodies are json
71-
console.log("content: ", content)
70+
console.log('content: ', content)
7271
content = JSON.parse(content)
73-
7472
} catch (e) {
7573
throw new Error('Content to POST does not appear to be JSON. Only JSON supported currently.')
7674
}
@@ -204,10 +202,9 @@ else if (command === 'help') {
204202
}
205203

206204
// Execute the command
207-
exec = commandGroup.exec
205+
const exec = commandGroup.exec
208206
if (exec) exec.apply(null, args)
209207
else help(command)
210-
211208
} catch (e) {
212209
console.log('Error thrown: ', e)
213210

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nypl/nypl-data-api-client",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Simple client for interacting with NYPL's internal data api",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)