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

webdetta

Package Overview
Dependencies
Maintainers
0
Versions
482
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webdetta - npm Package Compare versions

Comparing version 0.0.80 to 0.0.81

6

package.json
{
"name": "webdetta",
"version": "0.0.80",
"version": "0.0.81",
"author": "Fedot Kriutchenko <fodyadev@gmail.com>",

@@ -22,2 +22,5 @@ "description": "",

"dependencies": {
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-virtual": "^3.0.2",
"body-parser": "^1.20.2",

@@ -31,4 +34,5 @@ "bytes": "^3.1.2",

"path-to-regexp": "^6.2.2",
"rollup": "^4.20.0",
"ws": "^8.17.0"
}
}

31

src/sdk/server.js

@@ -24,3 +24,3 @@ import { validateSdkEntry } from './defs.js';

}
export const SdkServer = (methods) => {

@@ -33,6 +33,6 @@ const clientEntries = [];

].join('\n');
const serverMethods = {};
const serverEntries = [];
for (const [key, entry] of Object.entries(methods)) {

@@ -43,3 +43,3 @@ validateSdkEntry(entry);

const handlerId = fullpath.join('.');
const cli = d.client(handlerId);

@@ -54,3 +54,3 @@ clientEntries.push({

});
const srv = d.server(handlerId);

@@ -71,6 +71,20 @@ serverEntries.push({

SdkInstance(null, serverMethods, serverEntries);
return { serverMethods, clientCode };
}
import {rollup} from 'rollup';
import PluginVirtual from '@rollup/plugin-virtual';
import NodeResolve from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
const bundleCode = async code => {
const bundle = await rollup({
input: 'code',
plugins: [PluginVirtual({ code }), NodeResolve(), terser()],
});
const result = await bundle.generate({ format: 'es' });
return result.output[0].code;
}
const bundledCode = {};
SdkServer.clientCodeHttpHandler = ({

@@ -80,3 +94,3 @@ isSecure,

transport='ws'
}) => (req, res) => {
}) => async (req, res) => {
const url = Object.assign(new URL('http://localhost'), {

@@ -87,4 +101,5 @@ host: req.headers.host,

});
const code = clientCode(url, transport);
res.contentType('text/javascript');
res.send(clientCode(url, transport));
res.send(bundledCode[[url, transport]] ??= await bundleCode(code));
}
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