UNPKG

230 BJavaScriptView Raw
1'use strict';
2
3const { TemplateTag } = require('common-tags');
4
5const shellEscape = new TemplateTag({
6 onSubstitution (substitution) {
7 return substitution.replace(/['"$`\\]/gu, `\\$&`);
8 }
9});
10
11module.exports = shellEscape;