Skip to content

Commit

Permalink
fix: more accurate test for figma urls
Browse files Browse the repository at this point in the history
  • Loading branch information
roperzh committed Nov 14, 2019
1 parent bd936f5 commit c50437a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/designfile/src/exporters/figma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const getSVGLinks = async (elements: FigmaNode[], id: string, authToken:
const parseProjectURL = (rawURL: string) => {
const parsedURL = url.parse(rawURL);

if (parsedURL && parsedURL.pathname && parsedURL.host && parsedURL.host.includes(FIGMA_HOST)) {
if (parsedURL && parsedURL.pathname && parsedURL.host && parsedURL.host.endsWith(FIGMA_HOST)) {
const paths = parsedURL.pathname.split('/');
return {id: paths[2] || '', name: paths[3] || FIGMA_DEFAULT_FILENAME};
}
Expand Down

0 comments on commit c50437a

Please sign in to comment.