Skip to content

Commit

Permalink
use ?. syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Groß committed Sep 13, 2021
1 parent 7d1b7fb commit 3cd8393
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/_makeChunks.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const _makeChunks = (str, queue) => {
// Using dynamic regex to ensure that only the correct property
// at the end of the string it's actually selected.
// => e.g. ,"a":{"a": => ,"a":{
const matchProp = `("${(queue[i] || {}).name}":(\"?))$`;
const matchProp = `("${queue[i]?.name}":(\"?))$`;

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

0 comments on commit 3cd8393

Please sign in to comment.