Skip to content

Commit 0293dca

Browse files
authored
refactor: updating display string to show 'null' as '-' (#746)
1 parent cb55ce1 commit 0293dca

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

projects/common/src/utilities/formatters/string/string-formatter.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ describe('String formatter', () => {
44
test('can convert to display string', () => {
55
// tslint:disable-next-line: no-null-keyword
66
expect(displayString(null)).toBe('-');
7+
expect(displayString('null')).toBe('-');
78
expect(displayString(undefined)).toBe('-');
89
expect(displayString('')).toBe('');
910
expect(displayString('value')).toBe('value');

projects/common/src/utilities/formatters/string/string-formatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const displayString = (provided?: unknown): string => {
2-
if (provided === null) {
2+
if (provided === null || provided === 'null') {
33
return '-';
44
}
55

0 commit comments

Comments
 (0)