Sha256: a19fe69628fd1e9f4c82eb36a541de19e595702b2fd1186b10d6b61c63da1414
Contents?: true
Size: 367 Bytes
Versions: 4
Compression:
Stored size: 367 Bytes
Contents
'use strict'; module.exports = function (str) { return str.replace(/(?:\\*)?'([^'\\]*\\.)*[^']*'/g, function (match) { return match // unescape single-quotes .replace(/\\'/g, '\'') // escape escapes .replace(/(^|[^\\])(\\+)"/g, '$1$2\\\"') // escape double-quotes .replace(/([^\\])"/g, '$1\\\"') // convert .replace(/^'|'$/g, '"'); }); };
Version data entries
4 entries across 4 versions & 2 rubygems