unquote.js 212 B

123456
  1. module.exports = function unquote(str, quoteChar) {
  2. quoteChar = quoteChar || '"';
  3. if (str[0] === quoteChar && str[str.length - 1] === quoteChar)
  4. return str.slice(1, str.length - 1);
  5. else return str;
  6. };