File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @pipedream/sdk" ,
3- "version" : " 1.0.4 " ,
3+ "version" : " 1.0.5 " ,
44 "description" : " Pipedream SDK" ,
55 "main" : " dist/server/index.js" ,
66 "module" : " dist/server/index.js" ,
Original file line number Diff line number Diff line change @@ -353,10 +353,8 @@ export class BackendClient {
353353 * @param opts - The options for configuring the server client.
354354 */
355355 constructor ( opts : BackendClientOpts ) {
356- if ( ! opts . environment || ! [ "development" , "production" ] . includes ( opts . environment ) ) {
357- throw new Error ( "Project environment is required. Supported environments are development and production." ) ;
358- }
359- this . environment = opts . environment
356+ this . ensureValidEnvironment ( opts . environment )
357+ this . environment = opts . environment ! !
360358
361359 this . projectId = opts . projectId ;
362360 if ( ! this . projectId ) {
@@ -373,6 +371,12 @@ export class BackendClient {
373371 this . oauthClient = this . newOauthClient ( opts . credentials , this . baseApiUrl ) ;
374372 }
375373
374+ private ensureValidEnvironment ( environment ?: string ) {
375+ if ( ! environment || ! [ "development" , "production" ] . includes ( environment ) ) {
376+ throw new Error ( "Project environment is required. Supported environments are development and production." ) ;
377+ }
378+ }
379+
376380 private newOauthClient (
377381 {
378382 clientId,
You can’t perform that action at this time.
0 commit comments