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

@01/as-virtual-code

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@01/as-virtual-code - npm Package Compare versions

Comparing version 0.0.1-alpha5 to 0.0.1-alpha6

31

assembly/virtual-code/index.ts

@@ -120,2 +120,33 @@ import { JSON } from "assemblyscript-json";

export class EvaluationPayload {
constructor(
public code: JSON.Obj,
public context: EvaluationContext,
public store: EvaluationStore
) {}
fromJSON(data: JSON.Obj): EvaluationPayload {
if (data.isObj) {
const code: JSON.Obj | null = data.get("code") as JSON.Obj;
const ctxData: JSON.Obj | null = data.get("context") as JSON.Obj;
const storeData: JSON.Obj | null = data.get("store") as JSON.Obj;
if (code != null) {
const context = new EvaluationContext(
ctxData ? ctxData : new JSON.Obj()
);
const store = new EvaluationStore(
storeData ? storeData : new JSON.Obj()
);
return new EvaluationPayload(code, context, store);
}
throw new Error(`Invalid payload, code is null`);
}
throw new Error(`Invalid payload, data not an object`);
}
fromString(data: string): EvaluationPayload {
return this.fromJSON(<JSON.Obj>JSON.parse(data));
}
}
export function evaluate(

@@ -122,0 +153,0 @@ codeData: string,

2

package.json
{
"name": "@01/as-virtual-code",
"description": "JSON Based Virtual Code Evaluator written in AssemblyScript",
"version": "0.0.1-alpha5",
"version": "0.0.1-alpha6",
"types": "assembly/index.ts",

@@ -6,0 +6,0 @@ "private": false,

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