mirror of https://github.com/nocodb/nocodb
1 changed files with 2 additions and 0 deletions
@ -1,9 +1,11 @@
|
||||
export function sanitize(v) { |
||||
if (typeof v !== 'string') return v; |
||||
return v?.replace(/([^\\]|^)(\?+)/g, (_, m1, m2) => { |
||||
return `${m1}${m2.split('?').join('\\?')}`; |
||||
}); |
||||
} |
||||
|
||||
export function unsanitize(v) { |
||||
if (typeof v !== 'string') return v; |
||||
return v?.replace(/\\[?]/g, '?'); |
||||
} |
||||
|
Loading…
Reference in new issue