New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

esplay

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esplay - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

README.md

11

index.js

@@ -5,7 +5,12 @@ document.onreadystatechange = () => {

const babelText = document.querySelector("script[type='text/babel']").textContent;
const importFromPattern = /^\s*import(.+)from\s+['"](.+)['"]/gm;
const importFromPattern = /^\s*import(?:.|\n)*?(?:from)?\s+['"](.+)['"]/gm;
const importMatches = [...babelText.matchAll(importFromPattern)];
const importFroms = importMatches.map((m) => m[2]);
const imports = Object.fromEntries(importFroms.map((from) => [from, `https://esm.sh/${from}?external=react`]));
const importFroms = importMatches.map((m) => m[1]);
const imports = {
...Object.fromEntries(importFroms.map((from) => [from, `https://esm.sh/${from}?external=react`])),
react: "https://esm.sh/react",
"react-dom/client": "https://esm.sh/react-dom/client",
"react/jsx-runtime": "https://esm.sh/react/jsx-runtime",
};

@@ -12,0 +17,0 @@ console.log(`[esplay]`, { imports });

{
"name": "esplay",
"version": "0.0.2",
"version": "0.0.3",
"main": "index.js",

@@ -25,2 +25,2 @@ "scripts": {

}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc