mirror of https://github.com/AMT-Cheif/drift.git
Escape strings before writing dart literals
This commit is contained in:
parent
646987ad69
commit
d930664581
|
@ -1,3 +1,4 @@
|
||||||
String asDartLiteral(String value) {
|
String asDartLiteral(String value) {
|
||||||
return "'$value'"; // todo proper escaping
|
final escaped = value.replaceAll("'", "\\'").replaceAll('\n', '\\n');
|
||||||
|
return "'$escaped'";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue