UNPKG

opnet-transform-web

Version:

OP_NET AssemblyScript transformer

12 lines (11 loc) 342 B
export function unquote(raw) { // 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; }