Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

edge

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

edge - npm Package Compare versions

Comparing version 0.7.8 to 0.7.9

samples/206_registry_read.js

5

package.json

@@ -8,3 +8,3 @@ {

},
"version": "0.7.8",
"version": "0.7.9",
"description": "Edge.js: run .NET and node.js code in-process",

@@ -24,2 +24,3 @@ "tags": [

},
"os": [ "win32" ],
"licenses": [

@@ -32,3 +33,3 @@ {

"dependencies": {
"edge-cs": "0.2.0"
"edge-cs": "0.2.2"
},

@@ -35,0 +36,0 @@ "devDependencies": {

17

samples/106_marshal_v82clr.js

@@ -6,18 +6,13 @@ // Overview of edge.js: http://tjanczuk.github.com/edge

var hello = edge.func(function () {/*
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
public class Startup
async (data) =>
{
public async Task<object> Invoke(IDictionary<string,object> input)
Console.WriteLine("-----> In .NET:");
foreach (var kv in (IDictionary<string,object>)data)
{
Console.WriteLine("-----> In .NET:");
foreach (var kv in input)
{
Console.WriteLine(kv.Key + ": " + kv.Value.GetType());
}
Console.WriteLine(kv.Key + ": " + kv.Value.GetType());
}
return null;
}
return null;
}

@@ -24,0 +19,0 @@ */});

@@ -6,14 +6,10 @@ // Overview of edge.js: http://tjanczuk.github.com/edge

var addAndMultiplyBy2 = edge.func(function () {/*
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
public class Startup
async (data) =>
{
public async Task<object> Invoke(IDictionary<string,object> input)
{
int sum = (int)(input["a"]) + (int)(input["b"]);
var multiplyBy2 = (Func<object,Task<object>>)input["multiplyBy2"];
return await multiplyBy2(sum);
}
var input = (IDictionary<string,object>)data;
int sum = (int)(input["a"]) + (int)(input["b"]);
var multiplyBy2 = (Func<object,Task<object>>)input["multiplyBy2"];
return await multiplyBy2(sum);
}

@@ -20,0 +16,0 @@ */});

@@ -6,32 +6,28 @@ // Overview of edge.js: http://tjanczuk.github.com/edge

var listCertificates = edge.func(function() {/*
//#r "System.dll"
#r "System.dll"
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.Collections.Generic;
class Startup
async (data) =>
{
public async Task<object> Invoke(IDictionary<string,object> input)
var input = (IDictionary<string,object>)data;
X509Store store = new X509Store(
(string)input["storeName"],
(StoreLocation)Enum.Parse(typeof(StoreLocation), (string)input["storeLocation"]));
store.Open(OpenFlags.ReadOnly);
try
{
X509Store store = new X509Store(
(string)input["storeName"],
(StoreLocation)Enum.Parse(typeof(StoreLocation), (string)input["storeLocation"]));
store.Open(OpenFlags.ReadOnly);
try
List<string> result = new List<string>();
foreach (X509Certificate2 certificate in store.Certificates)
{
List<string> result = new List<string>();
foreach (X509Certificate2 certificate in store.Certificates)
{
result.Add(certificate.Subject);
}
result.Add(certificate.Subject);
}
return result;
}
finally
{
store.Close();
}
return result;
}
finally
{
store.Close();
}
}

@@ -38,0 +34,0 @@ */});

@@ -6,17 +6,20 @@ // Overview of edge.js: http://tjanczuk.github.com/edge

var writeEventLog = edge.func(function() {/*
using System.Collections.Generic;
using System.Diagnostics;
async (input) =>
{
var parameters = (System.Collections.Generic.IDictionary<string,object>)input;
var parameters = (IDictionary<string,object>)input;
var source = (string)parameters["source"];
var log = (string)parameters["log"];
if (!System.Diagnostics.EventLog.SourceExists(source))
if (!EventLog.SourceExists(source))
{
System.Diagnostics.EventLog.CreateEventSource(source, log);
EventLog.CreateEventSource(source, log);
}
System.Diagnostics.EventLog.WriteEntry(
EventLog.WriteEntry(
source,
(string)parameters["message"],
(System.Diagnostics.EventLogEntryType)Enum.Parse(
typeof(System.Diagnostics.EventLogEntryType), (string)parameters["type"]),
(EventLogEntryType)Enum.Parse(
typeof(EventLogEntryType), (string)parameters["type"]),
(int)parameters["id"]

@@ -23,0 +26,0 @@ );

@@ -171,3 +171,3 @@ var edge = require('../lib/edge.js'), assert = require('assert');

it('succeeds with System.Data.dll reference', function (done) {
it('succeeds with System.Data.dll reference as comment in class', function (done) {
var func = edge.func({

@@ -195,2 +195,83 @@ source: function () {/*

});
it('succeeds with System.Data.dll reference without comment in class', function (done) {
var func = edge.func({
source: function () {/*
#r "System.Data.dll"
using System.Threading.Tasks;
using System.Data;
public class Startup
{
public async Task<object> Invoke(object input)
{
return "Hello, " + input.ToString();
}
}
*/}
});
func("JavaScript", function (error, result) {
assert.ifError(error);
assert.equal(result, 'Hello, JavaScript');
done();
});
});
it('succeeds with System.Data.dll reference as comment in async lambda', function (done) {
var func = edge.func({
source: function () {/*
//#r "System.Data.dll"
async (input) =>
{
return "Hello, " + input.ToString();
}
*/}
});
func("JavaScript", function (error, result) {
assert.ifError(error);
assert.equal(result, 'Hello, JavaScript');
done();
});
});
it('succeeds with System.Data.dll reference without comment in async lambda', function (done) {
var func = edge.func({
source: function () {/*
#r "System.Data.dll"
async (input) =>
{
return "Hello, " + input.ToString();
}
*/}
});
func("JavaScript", function (error, result) {
assert.ifError(error);
assert.equal(result, 'Hello, JavaScript');
done();
});
});
it('succeeds with System.Data.dll reference and a using statement in async lambda', function (done) {
var func = edge.func({
source: function () {/*
#r "System.Data.dll"
using System.Data;
async (input) =>
{
return input.ToString() + " is " + SqlDbType.Real.ToString();
}
*/}
});
func("JavaScript", function (error, result) {
assert.ifError(error);
assert.equal(result, 'JavaScript is Real');
done();
});
});
});
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