Skip to content

Commit 3cd8393

Browse files
author
Jacob Groß
committed
use ?. syntax
1 parent 7d1b7fb commit 3cd8393

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_makeChunks.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const _makeChunks = (str, queue) => {
3232
// Using dynamic regex to ensure that only the correct property
3333
// at the end of the string it's actually selected.
3434
// => e.g. ,"a":{"a": => ,"a":{
35-
const matchProp = `("${(queue[i] || {}).name}":(\"?))$`;
35+
const matchProp = `("${queue[i]?.name}":(\"?))$`;
3636

3737
// Check if current chunk is the last one inside a nested property
3838
const isLast = _isLastRegex.test(chunks[i + 1] || "");

0 commit comments

Comments
 (0)