Skip to content
This repository was archived by the owner on Nov 26, 2024. It is now read-only.

Commit 1708fd1

Browse files
lint fixes to tests
1 parent 69cb4b3 commit 1708fd1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/js/typography/typography.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,15 @@ function trimStringAfterCharacter(str: string, char = '.') {
4040
function createNewFigmaTokenObject(str: string, obj: any) {
4141
const firstString = trimStringBetweenCharacters(str);
4242
const secondString = trimStringAfterCharacter(str);
43-
return obj[`${firstString}`][`${secondString}`];
43+
if (
44+
firstString &&
45+
secondString &&
46+
obj[firstString] &&
47+
obj[firstString][secondString]
48+
) {
49+
return obj[firstString][secondString];
50+
}
51+
return null;
4452
}
4553

4654
describe('Typography', () => {

0 commit comments

Comments
 (0)