INNER CODE UNIT · JavaScript

regex

sebastiancarlos/beachpatrol · .internal-scripts/postinstall.js:26

  const regex = /playwright ([\w-]+) v\d+[^\n]*\n\s+Install location:\s+([^\n]*)/gm;
  let match;
  const locations = {};
  while ((match = regex.exec(playWrightDryInstallOutput)) !== null) {
    const browserName = match[1];
    const installPath = match[2];
    if (SUPPORTED_BROWSERS.includes(browserName)) {
      locations[browserName] = installPath;
    }
  }

  // Check which browsers are installed by checking if the install path exists.
  const installedBrowsers = [];
  for (const browserName in locations) {
    const browserPath = locations[browserName];
    try {
      await access(browserPath);
      installedBrowsers.push(browserName);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…