Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mt-max committed Aug 24, 2023
1 parent e48b16e commit 0479643
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/api/__tests__/authorize-url.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ jest.mock('../../storage');

describe('api', () => {
describe('authorize-url', () => {
const open = (window.open = jest.fn());

const mockedStorage = mocked(storage);

const clientId = 'clientId';
Expand Down
4 changes: 2 additions & 2 deletions src/api/__tests__/onboard-url.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('api', () => {

test('without calling init', () => {
expect(() => {
const url = onboardUrl(new MtLinkSdk().storedOptions);
onboardUrl(new MtLinkSdk().storedOptions);
}).toThrow('[mt-link-sdk] Make sure to call `init` before calling `onboardUrl/onboard`.');
});

Expand All @@ -28,7 +28,7 @@ describe('api', () => {
mtLinkSdk.init(clientId);

expect(() => {
const url = onboardUrl(mtLinkSdk.storedOptions);
onboardUrl(mtLinkSdk.storedOptions);
}).toThrow(
'[mt-link-sdk] Missing option `redirectUri` in `onboardUrl/onboard`, make sure to pass one via `onboardUrl/onboard` options or `init` options.'
);
Expand Down
7 changes: 3 additions & 4 deletions src/api/open-service-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ export default function openServiceUrl(
return stringify(query);
};

const { view: vaultView } = options as VaultServiceTypes;

switch (serviceId) {
case 'vault':
let { view: vaultView } = options as VaultServiceTypes;

if (!vaultView) {
return `${VAULT_DOMAINS[mode]}?${getQueryValue()}`;
}
Expand Down Expand Up @@ -123,8 +123,7 @@ export default function openServiceUrl(
}

case 'myaccount':
let { view: myAccountView = '' } = options as MyAccountServiceTypes;
return `${MY_ACCOUNT_DOMAINS[mode]}/${myAccountView}?${getQueryValue()}`;
return `${MY_ACCOUNT_DOMAINS[mode]}/${(options as MyAccountServiceTypes).view || ''}?${getQueryValue()}`;

case 'link-kit':
return `${LINK_KIT_DOMAINS[mode]}?${getQueryValue()}`;
Expand Down
2 changes: 1 addition & 1 deletion src/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { stringify } from 'qs';
import { snakeCase } from 'snake-case';
import { createHash } from 'crypto';
import { encode } from 'url-safe-base64';
import { v4 as uuid, version } from 'uuid';
import { v4 as uuid } from 'uuid';
import storage from './storage';

import {
Expand Down

0 comments on commit 0479643

Please sign in to comment.