mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
refactor(addons/links): resolve ts-expect-error
This commit is contained in:
parent
a81b40504f
commit
cabfab8a52
@ -37,9 +37,7 @@ export const hrefTo = (title: ComponentTitle, name: StoryName): Promise<string>
|
|||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
const { location } = document;
|
const { location } = document;
|
||||||
const query = parseQuery(location.search);
|
const query = parseQuery(location.search);
|
||||||
// @ts-expect-error (Converted from ts-ignore)
|
const existingId = query.id;
|
||||||
const existingId = [].concat(query.id)[0];
|
|
||||||
// @ts-expect-error (Converted from ts-ignore)
|
|
||||||
const titleToLink = title || existingId.split('--', 2)[0];
|
const titleToLink = title || existingId.split('--', 2)[0];
|
||||||
const id = toId(titleToLink, name);
|
const id = toId(titleToLink, name);
|
||||||
const path = `/story/${id}`;
|
const path = `/story/${id}`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user