12 lines
1.4 KiB
JavaScript
12 lines
1.4 KiB
JavaScript
|
"use strict";
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
const QUOTE_RE = /["']/;
|
||
|
function default_1(string) {
|
||
|
const start = string[0];
|
||
|
const end = string[string.length - 1];
|
||
|
if (start !== end || !start.match(QUOTE_RE))
|
||
|
return string;
|
||
|
return string.slice(1, string.length - 1);
|
||
|
}
|
||
|
exports.default = default_1;
|
||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW5xdW90ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy91bnF1b3RlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsTUFBTSxRQUFRLEdBQUcsTUFBTSxDQUFDO0FBRXhCLG1CQUF5QixNQUFNO0lBQzNCLE1BQU0sS0FBSyxHQUFHLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUN4QixNQUFNLEdBQUcsR0FBSyxNQUFNLENBQUMsTUFBTSxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQztJQUV4QyxJQUFJLEtBQUssS0FBSyxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsS0FBSyxDQUFDLFFBQVEsQ0FBQztRQUN2QyxPQUFPLE1BQU0sQ0FBQztJQUVsQixPQUFPLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxNQUFNLEdBQUcsQ0FBQyxDQUFDLENBQUM7QUFDOUMsQ0FBQztBQVJELDRCQVFDIiwic291cmNlc0NvbnRlbnQiOlsiY29uc3QgUVVPVEVfUkUgPSAvW1wiJ10vO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgY29uc3Qgc3RhcnQgPSBzdHJpbmdbMF07XG4gICAgY29uc3QgZW5kICAgPS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