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

@giteeteam/apps-runtime-vm

Package Overview
Dependencies
Maintainers
5
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@giteeteam/apps-runtime-vm - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

14

lib/sandbox-isolate/api/index.js

@@ -8,2 +8,6 @@ "use strict";

const isolated_vm_1 = __importDefault(require("isolated-vm"));
// eslint-disable-next-line @typescript-eslint/ban-types
const isAsync = (apiFunction) => {
return !!apiFunction.toString().match(/async/);
};
// 注入单个方法

@@ -16,4 +20,10 @@ const injectApiFunctions = async (context, globalName, apiFunctions) => {

for (let i = 0; i < funNames.length; ++i) {
evalFunctions.push(`${funNames[i]}: (...args) => $${i + 1}.apply(null, [new $0.Reference(args)], { result: { promise: true, copy: true } })`);
evalArgs.push(new isolated_vm_1.default.Reference(apiFunctions[funNames[i]]));
const apiFunction = apiFunctions[funNames[i]];
if (isAsync(apiFunction)) {
evalFunctions.push(`${funNames[i]}: (...args) => $${i + 1}.apply(null, [new $0.Reference(args)], { result: { promise: true, copy: true } })`);
}
else {
evalFunctions.push(`${funNames[i]}: (...args) => $${i + 1}.applySync(null, [new $0.Reference(args)], { result: { copy: true } })`);
}
evalArgs.push(new isolated_vm_1.default.Reference(apiFunction));
}

@@ -20,0 +30,0 @@ const evalCode = `globalThis.${globalName} = {${evalFunctions.join(',')}};`;

7

package.json
{
"name": "@giteeteam/apps-runtime-vm",
"version": "0.3.1",
"version": "0.4.0",
"description": "Giteeteam Apps Runtime VM",

@@ -27,4 +27,5 @@ "keywords": [

"build": "rm -rf lib && tsc",
"prepare": "pnpm run build",
"prepublish": "pnpm run build"
"prepare": "pnpm build",
"prepack": "pnpm build",
"prepublish": "pnpm build"
},

@@ -31,0 +32,0 @@ "publishConfig": {

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