mirror of https://github.com/aminya/setup-cpp
8 lines
301 B
TypeScript
8 lines
301 B
TypeScript
|
import escapeSpace from "escape-path-with-spaces"
|
||
|
import escapeQuote from "escape-quotes"
|
||
|
|
||
|
export function escapeString(valGiven: string, shouldEscapeSpace: boolean = false) {
|
||
|
const spaceEscaped = shouldEscapeSpace ? escapeSpace(valGiven) : valGiven
|
||
|
return escapeQuote(spaceEscaped, "\"", "\\")
|
||
|
}
|