Skip to content

Commit 2011d10

Browse files
authored
fix: string parsing (#4225)
1 parent 718d3e3 commit 2011d10

File tree

1 file changed

+19
-0
lines changed
  • src/writeData/subscriptions/utils

1 file changed

+19
-0
lines changed

src/writeData/subscriptions/utils/form.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,25 @@ export const sanitizeForm = (form: Subscription): Subscription => {
4444
}
4545
})
4646
}
47+
if (form.stringMeasurement) {
48+
form.stringMeasurement.pattern = form.stringMeasurement.pattern.replace(
49+
/\\\\/g,
50+
'\\'
51+
)
52+
}
53+
if (form.stringFields) {
54+
form.stringFields.map(f => {
55+
f.pattern = f.pattern.replace(/\\\\/g, '\\')
56+
})
57+
}
58+
if (form.stringTags) {
59+
form.stringTags.map(t => {
60+
t.pattern = t.pattern.replace(/\\\\/g, '\\')
61+
})
62+
}
63+
if (form.stringTimestamp.pattern === '') {
64+
delete form.stringTimestamp
65+
}
4766
if (form.brokerPassword === '' || form.brokerUsername === '') {
4867
delete form.brokerUsername
4968
delete form.brokerPassword

0 commit comments

Comments
 (0)