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

evaldown

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

evaldown - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

5

lib/InspectedConsole.js

@@ -75,5 +75,6 @@ const symbols = {

// handle the first line
output.append(lines.shift());
output.append(lines[0]);
// now add other lines with spaces between
for (const line of lines) {
const remainingLines = lines.slice(1);
for (const line of remainingLines) {
output.nl().append(line);

@@ -80,0 +81,0 @@ }

18

lib/md/evaluateSnippets.js

@@ -78,2 +78,18 @@ var vm = require("vm");

function prepareFlagsForExecution(capture, snippet) {
const appliedFlagsSet = new Set(Object.keys(snippet.flags || {}));
// Determine if the snippet has a flag set that should
// take precedence over the capture mode. If one is found
// do not set the capture mode key - note this is needed
// because currently the modes are exclusive within eval.
const hasExplicitCaptureFlag = ["console", "nowrap", "return"].some(flag =>
appliedFlagsSet.has(flag)
);
return hasExplicitCaptureFlag
? { ...snippet.flags }
: { [capture]: true, ...snippet.flags };
}
function prepareEnvironmentForExecution(flags, global, markdown) {

@@ -228,3 +244,3 @@ const globalsToReplace = [];

const flags = { [capture]: true, ...snippet.flags };
const flags = prepareFlagsForExecution(capture, snippet);
const cleanup = prepareEnvironmentForExecution(flags, global, markdown);

@@ -231,0 +247,0 @@

{
"name": "evaldown",
"version": "0.3.0",
"version": "0.3.1",
"description": "Evalute JavaScript snippets in markdown files and output static pages.",

@@ -5,0 +5,0 @@ "main": "lib/Evaldown.js",

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