Skip to content

Commit c0a5ca0

Browse files
authored
Merge pull request #248 from drubin/jsonpath
Switch from jsonpath to jsonpath-plus
2 parents e5ec945 + 0b03c8f commit c0a5ca0

File tree

3 files changed

+19
-216
lines changed

3 files changed

+19
-216
lines changed

package-lock.json

Lines changed: 15 additions & 211 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"byline": "^5.0.0",
5757
"isomorphic-ws": "^4.0.1",
5858
"js-yaml": "^3.12.0",
59-
"jsonpath": "^1.0.1",
59+
"jsonpath-plus": "^0.19.0",
6060
"request": "^2.88.0",
6161
"shelljs": "^0.8.2",
6262
"tslib": "^1.9.3",

src/cloud_auth.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// workaround for issue https://github.com/dchester/jsonpath/issues/96
2-
import jsonpath = require('jsonpath/jsonpath.min');
1+
import * as jsonpath from 'jsonpath-plus';
32
import * as shelljs from 'shelljs';
43

54
import { Authenticator } from './auth';
@@ -81,7 +80,7 @@ export class CloudAuth implements Authenticator {
8180
const tokenPathKey = '$' + tokenPathKeyInConfig.slice(1, -1);
8281
const expiryPathKey = '$' + expiryPathKeyInConfig.slice(1, -1);
8382

84-
config['access-token'] = jsonpath.query(resultObj, tokenPathKey);
85-
config.expiry = jsonpath.query(resultObj, expiryPathKey);
83+
config['access-token'] = jsonpath.JSONPath(tokenPathKey, resultObj);
84+
config.expiry = jsonpath.JSONPath(expiryPathKey, resultObj);
8685
}
8786
}

0 commit comments

Comments
 (0)