Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
if (shouldUseSingleQuote) {
return "'" + raw.slice(1, -1).replace(/\\"/g, '"').replace(/'/g, "\\'") + "'";
} else {
return '"' + raw.slice(1, -1).replace(/\\'/g, "'").replace(/"/g, '\\"') + '"';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment