Skip to content

Commit

Permalink
update splitToTwoLines function for print-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
zetavg committed Jan 10, 2024
1 parent 661c1b7 commit 9890ccc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions App/app/consts/chars.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const PUNCTUATION_REGEX = /[ ,-/() ]/;
export const LINE_SPLITTING_PUNCTUATION_REGEX = /[,-/(]/;
export const PUNCTUATION_REGEX = /[ ,/() ]| - /;
export const LINE_SPLITTING_PUNCTUATION_REGEX = /[,(]| - | \/ /;
export const T_PUNCTUATION_REGEX = /[ ,-/ ]/;
4 changes: 4 additions & 0 deletions App/app/features/label-printers/print-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,9 @@ describe('splitToTwoLines', () => {
expect(
splitToTwoLines('SKÅDIS Pegboard - 56x56 cm - white', 24),
).toStrictEqual(['SKÅDIS Pegboard', '56x56 cm - white']);

expect(
splitToTwoLines('Storage Bag for ABC-123 and DEF-456', 20),
).toStrictEqual(['Storage Bag for', 'ABC-123 and DEF-456']);
});
});

0 comments on commit 9890ccc

Please sign in to comment.