Comparing version 0.5.0 to 0.5.1
@@ -21,3 +21,3 @@ #!/usr/bin/env node | ||
const cells = lib.parse(src); | ||
lib.update(cells); | ||
lib.update(cells, path.join(process.cwd(), filename)); | ||
@@ -24,0 +24,0 @@ const dst = cells.map(cell => |
'use strict'; | ||
const path = require('path'); | ||
const range = require('lodash.range'); | ||
const fsm = require('@wavedrom/fsm'); | ||
const update = (cells) => { | ||
const update = (cells, filename) => { | ||
const $ = {}; | ||
@@ -16,3 +17,3 @@ for (let i = 0; i < cells.length; i++) { | ||
return (function (lib) { | ||
const {fsm, fin, range, $} = lib; | ||
const {fsm, fin, range, $, require} = lib; | ||
return (${cell.src}); | ||
@@ -22,4 +23,5 @@ })`)()({ | ||
fin: undefined, | ||
range: range, | ||
$ | ||
range, | ||
$, | ||
require: (pat) => require(path.join(path.dirname(filename), pat)) | ||
}); | ||
@@ -30,12 +32,12 @@ } catch (err) { | ||
} | ||
if (res !== undefined) { | ||
if (Array.isArray(res)) { | ||
res = res.join('\n'); | ||
} | ||
// if (Array.isArray(res)) { | ||
// res = res.join('\n'); | ||
// } | ||
if (typeof res === 'string') { | ||
// const cell1 = cells[i + 1]; | ||
const cell2 = cells[i + 2]; | ||
if (cell2 && cell2.kind === 'meta' && cell2.src.trim() === 'fin') { | ||
cells[i + 1] = {kind: 'body', src: '\n' + res + '\n'}; | ||
cells[i + 1] = {kind: 'body', src: res}; | ||
} else { | ||
cells.splice(i + 1, 0, {kind: 'body', src: '\n' + res + '\n/* fin */'}); | ||
cells.splice(i + 1, 0, {kind: 'body', src: res + '/* fin */'}); | ||
} | ||
@@ -42,0 +44,0 @@ } |
{ | ||
"name": "autodrom", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "auto verilog from comments", | ||
@@ -32,3 +32,3 @@ "author": "Aliaksei Chapyzhenka", | ||
"@hpcc-js/wasm": "^1.12.7", | ||
"@wavedrom/fsm": "^0.6.0", | ||
"@wavedrom/fsm": "^0.6.1", | ||
"chokidar": "^3.5.2", | ||
@@ -35,0 +35,0 @@ "commander": "^8.3.0", |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
8539
193
2
Updated@wavedrom/fsm@^0.6.1