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

@jsreport/jsreport-scripts

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsreport/jsreport-scripts - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

12

lib/executeScript.js

@@ -6,2 +6,8 @@ const extend = require('node.extend.without.arrays')

module.exports = async function executeScript (reporter, script, method, req, res) {
let entityPath
if (script._id) {
entityPath = await reporter.folders.resolveEntityPath(script, 'scripts', req)
entityPath = entityPath.substring(0, entityPath.lastIndexOf('/'))
}
const requestContextMetaConfig = reporter.getRequestContextMetaConfig() || {}

@@ -47,2 +53,4 @@

const sandboxManager = {}
const executionFn = async ({ topLevelFunctions, restore, context }) => {

@@ -75,3 +83,3 @@ try {

// and unwrap proxies and descriptors into new sandbox object
const restoredSandbox = restore()
const restoredSandbox = sandboxManager.restore()

@@ -111,5 +119,7 @@ if (

return await reporter.runInSandbox({
manager: sandboxManager,
context: initialContext,
userCode: script.content,
executionFn,
currentPath: entityPath,
propertiesConfig: Object.keys(requestContextMetaConfig).reduce((acu, prop) => {

@@ -116,0 +126,0 @@ // configure properties inside the context of sandbox

2

lib/worker.js

@@ -17,3 +17,3 @@ /*!

reporter.beforeScriptListeners = reporter.createListenerCollection()
reporter.beforeScriptListeners = reporter.createListenerCollection('Scripts@beforeScript')

@@ -20,0 +20,0 @@ reporter.beforeRenderListeners.insert({

{
"name": "@jsreport/jsreport-scripts",
"version": "3.0.0",
"version": "3.0.1",
"description": "jsreport extension capable of running custom javascript functions during the rendering process",

@@ -32,6 +32,6 @@ "keywords": [

"devDependencies": {
"@jsreport/jsreport-assets": "3.0.0",
"@jsreport/jsreport-core": "3.0.0",
"@jsreport/jsreport-assets": "3.0.1",
"@jsreport/jsreport-core": "3.1.0",
"@jsreport/jsreport-jsrender": "3.0.0",
"@jsreport/studio-dev": "3.0.0",
"@jsreport/studio-dev": "3.0.1",
"bluebird": "3.7.2",

@@ -38,0 +38,0 @@ "mocha": "5.2.0",

@@ -10,4 +10,10 @@ # @jsreport/jsreport-scripts

### 3.0.1
- use relative path to the currently evaluated entity (use script path as the current entity path)
- fix performance issue in sandbox when using long buffers (don't use restore() of sandbox through a method attached to the sandbox)
- refactor ListenerCollection usage for better stack traces
### 3.0.0-beta.1
Adaptations for the v3 APIs
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