@jsreport/jsreport-assets
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -13,3 +13,3 @@ const fs = require('fs/promises') | ||
async function readAsset (reporter, definition, { id, name, encoding }, req) { | ||
async function readAsset (reporter, definition, { id, name, encoding, currentPath }, req) { | ||
const allowAssetsLinkedToFiles = definition.options.allowAssetsLinkedToFiles !== false | ||
@@ -67,3 +67,3 @@ | ||
assetName = [...pathParts].pop() | ||
const result = await reporter.folders.resolveEntityFromPath(name, 'assets', req) | ||
const result = await reporter.folders.resolveEntityFromPath(name, 'assets', { currentPath }, req) | ||
@@ -70,0 +70,0 @@ if (result) { |
@@ -110,3 +110,3 @@ const util = require('util') | ||
read: async (path, encoding, moduleMode = false) => { | ||
const r = await readAsset(reporter, definition, { id: null, name: path, encoding, moduleMode }, req) | ||
const r = await readAsset(reporter, definition, { id: null, name: path, encoding, moduleMode, currentPath: proxy.currentPath }, req) | ||
return r.content | ||
@@ -135,3 +135,3 @@ }, | ||
registerHelpers: async (path) => { | ||
const asset = await readAsset(reporter, definition, { id: null, name: path, encoding: 'utf8' }, req) | ||
const asset = await readAsset(reporter, definition, { id: null, name: path, encoding: 'utf8', currentPath: proxy.currentPath }, req) | ||
@@ -153,3 +153,3 @@ const functionNames = getTopLevelFunctions(asset.content.toString()) | ||
require: async (path) => { | ||
const r = await readAsset(reporter, definition, { id: null, name: path, encoding: 'utf8' }, req) | ||
const r = await readAsset(reporter, definition, { id: null, name: path, encoding: 'utf8', currentPath: proxy.currentPath }, req) | ||
@@ -156,0 +156,0 @@ const userCode = [ |
{ | ||
"name": "@jsreport/jsreport-assets", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "jsreport extension embedding static assets like fonts or helpers into the templates", | ||
@@ -44,8 +44,8 @@ "keywords": [ | ||
"devDependencies": { | ||
"@jsreport/jsreport-core": "3.0.0", | ||
"@jsreport/jsreport-express": "3.0.0", | ||
"@jsreport/jsreport-core": "3.1.0", | ||
"@jsreport/jsreport-express": "3.1.0", | ||
"@jsreport/jsreport-handlebars": "3.0.0", | ||
"@jsreport/jsreport-jsrender": "3.0.0", | ||
"@jsreport/jsreport-scripts": "3.0.0-beta.1", | ||
"@jsreport/studio-dev": "3.0.0", | ||
"@jsreport/jsreport-scripts": "3.0.0", | ||
"@jsreport/studio-dev": "3.0.1", | ||
"binary-extensions": "1.12.0", | ||
@@ -52,0 +52,0 @@ "mocha": "8.2.1", |
@@ -11,2 +11,6 @@ # @jsreport/jsreport-assets | ||
### 3.0.1 | ||
- use relative path to the currently evaluated entity (for example relative asset inside script should be relative to the script) | ||
### 3.0.0-beta.1 | ||
@@ -13,0 +17,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
204492
30
0