Skip to content

Commit e64302a

Browse files
committed
refactor: remove unused applyLineTransform functions
1 parent 0c1412f commit e64302a

2 files changed

Lines changed: 0 additions & 38 deletions

File tree

apps/web/src/features/upload/utils.test.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -152,32 +152,6 @@ describe('zodObjectInterpreter', () => {
152152
});
153153
});
154154

155-
describe('applyLineTransformsSet', () => {
156-
it('should parse a line with a single set', () => {
157-
expect(applyLineTransformsSet('SET(1, 2, 3)')).toBe('SET(1~~ 2~~ 3)');
158-
});
159-
it('should parse a line with a several sets and a number', () => {
160-
expect(applyLineTransformsSet('SET(1, 2, 3), 5, SET(7, 2)')).toBe('SET(1~~ 2~~ 3), 5, SET(7~~ 2)');
161-
});
162-
it('should return the line unchanged, if the line does not contain a set', () => {
163-
expect(applyLineTransformsSet('1, 2, 3')).toBe('1, 2, 3');
164-
});
165-
});
166-
167-
describe('applyLineTransformsArray', () => {
168-
it('should parse a line with a single set', () => {
169-
expect(applyLineTransformsArray('RECORD_ARRAY(test1:1,test2:2;)')).toBe('RECORD_ARRAY(test1:1++test2:2;)');
170-
});
171-
it('should parse a line with a several sets and a number', () => {
172-
expect(applyLineTransformsArray('RECORD_ARRAY(test1:1,test2:2;), 3, RECORD_ARRAY(test3:3,test4:4;)')).toBe(
173-
'RECORD_ARRAY(test1:1++test2:2;), 3, RECORD_ARRAY(test3:3++test4:4;)'
174-
);
175-
});
176-
it('should return the line unchanged, if the line does not contain a set', () => {
177-
expect(applyLineTransformsArray('1, 2, 3')).toBe('1, 2, 3');
178-
});
179-
});
180-
181155
describe('processInstrumentCSV', () => {
182156
const mockInstrument = { validationSchema: z.object({ foo: z.string() }) } satisfies Pick<
183157
AnyUnilingualFormInstrument,

apps/web/src/features/upload/utils.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -208,18 +208,6 @@ export function ObjectValueInterpreter(
208208
return { message: `Invalid ZodType`, success: false };
209209
}
210210

211-
export function applyLineTransformsSet(line: string) {
212-
return line.replaceAll(/SET\((.*?)\)/g, (match) => {
213-
return match.replaceAll(',', '~~');
214-
});
215-
}
216-
217-
export function applyLineTransformsArray(line: string) {
218-
return line.replaceAll(/RECORD_ARRAY\((.*?)\)/g, (match) => {
219-
return match.replaceAll(',', '++');
220-
});
221-
}
222-
223211
function formatTypeInfo(s: string, isOptional: boolean) {
224212
return isOptional ? `${s} (optional)` : s;
225213
}

0 commit comments

Comments
 (0)