mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
Fix missing module declarations, broken lings, broken formating and incorrect scopes in the documentation. For modules split over several files it appears the only viable option is to use the memberof directive on each documented member and only declare the index file as a module.
23 lines
354 B
JavaScript
23 lines
354 B
JavaScript
/**
|
|
* Utilities for dealing with Lua
|
|
* @module
|
|
*/
|
|
|
|
/**
|
|
* Escapes a string for inclusion into a lua string
|
|
*/
|
|
function escapeString(content) {
|
|
return content
|
|
.replace(/\\/g, "\\\\")
|
|
.replace(/"/g, '\\"')
|
|
.replace(/'/g, "\\'")
|
|
.replace(/\0/g, "\\0")
|
|
.replace(/\n/g, "\\n")
|
|
.replace(/\r/g, "\\r")
|
|
;
|
|
}
|
|
|
|
module.exports = {
|
|
escapeString,
|
|
}
|