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

@overturebio-stack/lectern-client

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@overturebio-stack/lectern-client - npm Package Compare versions

Comparing version 0.2.0 to 1.0.0

15

lib/schema-functions.js

@@ -407,5 +407,6 @@ "use strict";

};
const ctx = vm_1.default.createContext();
const validateWithScript = (field, record) => {
try {
const sandbox = {
const args = {
$row: record,

@@ -423,3 +424,2 @@ $field: record[field.name],

: field.restrictions.script;
const ctx = vm_1.default.createContext(sandbox);
let result = {

@@ -430,4 +430,7 @@ valid: false,

for (const scriptString of scripts) {
const script = new vm_1.default.Script(scriptString);
result = script.runInContext(ctx);
const script = getScript(scriptString);
const valFunc = script.runInContext(ctx);
if (!valFunc)
throw new Error('Invalid script');
result = valFunc(args);
/* Return the first script that's invalid. Otherwise result will be valid with message: 'ok'*/

@@ -447,2 +450,6 @@ if (!result.valid)

};
const getScript = (scriptString) => {
const script = new vm_1.default.Script(scriptString);
return script;
};
const buildError = (errorType, fieldName, index, info = {}) => {

@@ -449,0 +456,0 @@ const errorData = { errorType, fieldName, index, info };

{
"name": "@overturebio-stack/lectern-client",
"version": "0.2.0",
"version": "1.0.0",
"files": [

@@ -36,6 +36,6 @@ "lib/**/*"

"husky": "^3.0.0",
"rimraf": "^2.6.2",
"mocha": "^6.1.4",
"prettier": "^1.19.1",
"pretty-quick": "^1.11.1",
"rimraf": "^2.6.2",
"tslint": "^5.20.1",

@@ -46,9 +46,10 @@ "typedoc": "^0.17.7",

"dependencies": {
"ts-node": "^8.5.4",
"cd": "^0.3.3",
"deep-freeze": "^0.0.1",
"lodash": "^4.17.14",
"node-fetch": "^2.6.0",
"lodash": "^4.17.14",
"node-worker-threads-pool": "^1.2.2",
"promise-tools": "^2.1.0",
"winston": "^3.2.1",
"deep-freeze": "^0.0.1"
"ts-node": "^8.5.4",
"winston": "^3.2.1"
},

@@ -55,0 +56,0 @@ "prettier": {

Sorry, the diff of this file is not supported yet

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