mirror of
https://github.com/grafana/grafana.git
synced 2024-11-28 19:54:10 -06:00
17 lines
418 B
JavaScript
17 lines
418 B
JavaScript
/*
|
|
Text plugin
|
|
*/
|
|
exports.translate = function(load) {
|
|
load.metadata.format = 'amd';
|
|
return 'def' + 'ine(function() {\nreturn "' + load.source
|
|
.replace(/(["\\])/g, '\\$1')
|
|
.replace(/[\f]/g, "\\f")
|
|
.replace(/[\b]/g, "\\b")
|
|
.replace(/[\n]/g, "\\n")
|
|
.replace(/[\t]/g, "\\t")
|
|
.replace(/[\r]/g, "\\r")
|
|
.replace(/[\u2028]/g, "\\u2028")
|
|
.replace(/[\u2029]/g, "\\u2029")
|
|
+ '";\n});';
|
|
}
|