79298558

Date: 2024-12-20 23:04:12
Score: 1
Natty:
Report link

I have used a regex to replace / to change it to a https:// path.

const fileConents = `import { test } from "/some-path.js"`
  .replaceAll(/(^import [^"]+")\//gm, `$1${window.origin}/`);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Bart Louwers