replace-string-raw.js 287 B

1234567891011121314
  1. 'use strict';
  2. // Replace `StringLiteral` or `TemplateLiteral` node with raw text
  3. const replaceStringRaw = (fixer, node, raw) =>
  4. fixer.replaceTextRange(
  5. // Ignore quotes and backticks
  6. [
  7. node.range[0] + 1,
  8. node.range[1] - 1,
  9. ],
  10. raw,
  11. );
  12. module.exports = replaceStringRaw;