Skip to content

Commit 3e5c407

Browse files
cleanup
1 parent be7c2b2 commit 3e5c407

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/formats/utilities/createPropertyFormatterWithRef.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,10 @@ export default function createPropertyFormatterWithRef({
227227
return `${prefix}${ref.name}`
228228
}
229229
}
230-
// console.log('originalValue:', originalValue, JSON.stringify(originalIsObject), ref)
231-
232-
const objectReplaceRegex = (value as string).match(/{/)
233-
? new RegExp(`{${ref.path.join('\\.')}(\\.\\$?value)?}`, 'g')
234-
: refVal
235230
// TODO: add test
236231
// technically speaking a reference can be made to a number or boolean token, in this case we stringify it first
237232
value = `${value}`.replace(
238-
originalIsObject ? objectReplaceRegex : new RegExp(`{${ref.path.join('\\.')}(\\.\\$?value)?}`, 'g'),
233+
(value as string).match(/{/) ? new RegExp(`{${ref.path.join('\\.')}(\\.\\$?value)?}`, 'g') : refVal,
239234
replaceFunc,
240235
)
241236
}

0 commit comments

Comments
 (0)