INNER CODE UNIT · JavaScript

resolveAssetLocation

geekjourneyx/md2wechat-skill · scripts/install.js:58

function resolveAssetLocation(base, name) {
  if (!hasScheme(base)) {
    return path.join(base, name);
  }

  return base.endsWith("/") ? `${base}${name}` : `${base}/${name}`;
}

function downloadToFile(source, destinationPath) {
  if (!hasScheme(source)) {
    fs.copyFileSync(source, destinationPath);
    return Promise.resolve();
  }

  if (source.startsWith("file://")) {
    fs.copyFileSync(fileURLToPath(source), destinationPath);
    return Promise.resolve();
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…