Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Throws error when passing both dev and alpha options for MySky (#257). #352

Merged
merged 4 commits into from
Mar 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
dist
yarn-error.log
coverage
.vscode

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit add newline

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make this change when I have time.

6 changes: 5 additions & 1 deletion src/mysky/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ export class MySky {
}

let domain = MYSKY_DOMAIN;
if (opts.alpha) {
if (opts.alpha && opts.dev) {
throw new Error(
`Cannot redirect to both Alpha MySky Domain and Dev MySky Domain. Please pass either the 'dev' or the 'alpha' option, not both.`
);
} else if (opts.alpha) {
domain = MYSKY_ALPHA_DOMAIN;
} else if (opts.dev) {
domain = MYSKY_DEV_DOMAIN;
Expand Down