Skip to content

Commit

Permalink
fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mishankov committed Mar 6, 2024
1 parent 834b4b7 commit fb1c930
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, it } from 'vitest';
import { doManipulation, type TManipulation } from '$lib/manipulations';
import { doManipulation } from '$lib/manipulations';

it('Test replace manipulation', () => {
expect(doManipulation('\\3', { type: 'replace', from: '\\\\3', to: 'result' })).eq('result');
Expand Down
6 changes: 3 additions & 3 deletions src/lib/manipulations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function prepareInput(input: string): string {
['\\\\t', '\t']
];

const preparedInput = stuffToReplace.reduce((previousResult, currentValue, index, array) => {
const preparedInput = stuffToReplace.reduce((previousResult, currentValue) => {
return previousResult.replaceAll(new RegExp(currentValue[0], 'g'), currentValue[1]);
}, input);

Expand Down Expand Up @@ -116,7 +116,7 @@ function doManipulationInner(input: string, manipulation: TManipulation): string

if (splittedInput.length === 1) return input;

return splittedInput.reduce((previousResult, currentValue, currentIndex, array) => {
return splittedInput.reduce((previousResult, currentValue, currentIndex) => {
const placeholderWithIndex = manipulation.placeholder.replaceAll(
'd',
currentIndex.toString()
Expand All @@ -127,7 +127,7 @@ function doManipulationInner(input: string, manipulation: TManipulation): string
case 'splitJoin': {
return input
.split(prepareInput(manipulation.splitString))
.map((value, index, array) => {
.map((value) => {
return applyManipulations(value, manipulation.innerManipulations);
})
.join(prepareInput(manipulation.joinString));
Expand Down

0 comments on commit fb1c930

Please sign in to comment.