@btc-vision/opnet-transform
Version:
OP_NET AssemblyScript transform
13 lines (11 loc) • 371 B
text/typescript
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;
}