Files
30-seconds-of-code/node_modules/underscore.string/unquote.js
2019-08-20 15:52:05 +02:00

7 lines
212 B
JavaScript

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