UNPKG

opnet-transform-web

Version:

OP_NET AssemblyScript transformer

13 lines (11 loc) 371 B
export function unquote(raw: string): string { // If it starts and ends with double-quotes "…" if (raw.startsWith('"') && raw.endsWith('"')) { raw = raw.slice(1, -1); } // If it then starts and ends with single-quotes '…' if (raw.startsWith("'") && raw.endsWith("'")) { raw = raw.slice(1, -1); } return raw; }