Skip to content

Commit

Permalink
[chore]: find index
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangtran2506 committed Jul 18, 2023
1 parent 137fa1b commit 2e8adc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion __tests__/test-helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const flatArr = (arr: any) => Object.values(arr).flat(1);
export const sliceLinkDir = (linkDir) => {
const testSearch = '__tests__';
const linkDirArr = linkDir.split('/');
const index = linkDirArr.find((item: string) => item === testSearch);
const index = linkDirArr.findIndex((item: string) => item === testSearch);
if (index) linkDirArr.splice(index, 3);

return linkDirArr.join('/');
Expand Down

0 comments on commit 2e8adc8

Please sign in to comment.