Huge News!Announcing our $40M Series B led by Abstract Ventures.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-alpha to 0.0.1-alpha1

19

assembly/virtual-code/index.ts

@@ -24,3 +24,3 @@ import { JSON } from "assemblyscript-json";

export class ExecutionResult {
export class EvaluationResult {
status: EvaluationStatus;

@@ -58,3 +58,3 @@ message: string | null;

export function resultToString(result: ExecutionResult): string {
export function resultToString(result: EvaluationResult): string {
return result.toString();

@@ -122,2 +122,13 @@ }

export function evaluate(
codeData: string,
contextData: string,
storeData: string
): EvaluationResult {
const code = JSON.parse(codeData);
const context = new EvaluationContext(<JSON.Obj>JSON.parse(contextData));
const store = new EvaluationStore(<JSON.Obj>JSON.parse(storeData));
return evaluateCode(code, context, store);
}
export function evaluateCode(

@@ -127,4 +138,4 @@ code: VirtualCode,

store: EvaluationStore
): ExecutionResult {
const result = new ExecutionResult(context, store);
): EvaluationResult {
const result = new EvaluationResult(context, store);
if (code === null || code.isNull) {

@@ -131,0 +142,0 @@ result.return = code;

{
"name": "@01/as-virtual-code",
"description": "JSON Based Virtual Code Evaluator written in AssemblyScript",
"version": "0.0.1-alpha",
"version": "0.0.1-alpha1",
"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