Skip to content

Commit 4f84989

Browse files
Fix jsonpath-plus result typing
Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
1 parent eef32bb commit 4f84989

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎src/azure_auth.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ export class AzureAuth implements Authenticator {
9090
const tokenPathKey = '$' + tokenPathKeyInConfig.slice(1, -1);
9191
const expiryPathKey = '$' + expiryPathKeyInConfig.slice(1, -1);
9292

93-
config['access-token'] = jsonpath.JSONPath({ path: tokenPathKey, json: resultObj });
94-
config.expiry = jsonpath.JSONPath({ path: expiryPathKey, json: resultObj });
93+
config['access-token'] = jsonpath.JSONPath({
94+
path: tokenPathKey,
95+
json: resultObj,
96+
}) as Config['access-token'];
97+
config.expiry = jsonpath.JSONPath({ path: expiryPathKey, json: resultObj }) as Config['expiry'];
9598
}
9699
}

‎src/gcp_auth.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ export class GoogleCloudPlatformAuth implements Authenticator {
8686
const tokenPathKey = '$' + tokenPathKeyInConfig.slice(1, -1);
8787
const expiryPathKey = '$' + expiryPathKeyInConfig.slice(1, -1);
8888

89-
config['access-token'] = jsonpath.JSONPath({ path: tokenPathKey, json: resultObj });
90-
config.expiry = jsonpath.JSONPath({ path: expiryPathKey, json: resultObj });
89+
config['access-token'] = jsonpath.JSONPath({
90+
path: tokenPathKey,
91+
json: resultObj,
92+
}) as Config['access-token'];
93+
config.expiry = jsonpath.JSONPath({ path: expiryPathKey, json: resultObj }) as Config['expiry'];
9194
}
9295
}

0 commit comments

Comments
 (0)