Skip to content

Commit

Permalink
refactor: replace uniq with lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkl2533 committed Aug 5, 2020
1 parent 61ee8b0 commit 054947a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/components/src/blocks/ArgsTable/ArgValue.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { FC, useState } from 'react';
import { styled } from '@storybook/theming';
import memoize from 'memoizerific';
import uniq from 'lodash/uniq';
import { PropSummaryValue } from './types';
import { WithTooltipPure } from '../../tooltip/WithTooltip';
import { Icons } from '../../icon/icon';
Expand Down Expand Up @@ -99,9 +100,6 @@ const calculateDetailWidth = memoize(1000)((detail: string): string => {
return `${Math.max(...lines.map((x) => x.length))}ch`;
});

const uniq = (arr: string[]): string[] =>
arr.filter((value, index, self) => self.indexOf(value) === index);

const getSummaryItems = (summary: string) => {
if (!summary) return [summary];
const splittedItems = summary.split('|');
Expand Down

0 comments on commit 054947a

Please sign in to comment.