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