New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jsreport/jsreport-localization

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsreport/jsreport-localization - npm Package Compare versions

Comparing version 3.1.1 to 3.2.0

20

lib/worker.js

@@ -15,5 +15,20 @@ const fs = require('fs').promises

reporter.beforeRenderListeners.add(definition.name, (req) => {
if (req.template.localization?.language != null && req.options.localization?.language == null) {
req.options.localization = Object.assign({}, req.options.localization, { language: req.template.localization.language })
}
})
reporter.extendProxy((proxy, req) => {
proxy.localization = {
localize: async function (key, folder) {
let language
if (typeof key === 'object') {
const options = key
key = options.key
folder = options.folder
language = options.language
}
if (key == null) {

@@ -31,6 +46,3 @@ throw new Error('localize expects key parameter')

let language = req.options.localization ? req.options.localization.language : req.options.language
if (!language) {
language = req.template.localization ? req.template.localization.language : null
}
language = language || (req.options.localization ? req.options.localization.language : req.options.language)

@@ -37,0 +49,0 @@ if (!language) {

9

package.json
{
"name": "@jsreport/jsreport-localization",
"version": "3.1.1",
"version": "3.2.0",
"description": "jsreport extension adding localize helper",

@@ -36,7 +36,8 @@ "keywords": [

"handlebars": "4.7.7",
"@jsreport/jsreport-assets": "3.2.0",
"@jsreport/jsreport-core": "3.3.0",
"@jsreport/jsreport-assets": "3.3.0",
"@jsreport/jsreport-core": "3.4.0",
"@jsreport/jsreport-components": "3.2.0",
"@jsreport/jsreport-child-templates": "3.0.1",
"@jsreport/jsreport-handlebars": "3.0.0",
"@jsreport/studio-dev": "3.0.1",
"@jsreport/studio-dev": "3.1.0",
"mocha": "8.3.2",

@@ -43,0 +44,0 @@ "should": "13.2.3",

@@ -10,2 +10,6 @@ # jsreport-localization

### 3.2.0
accept object for localize function and propagate req.template.localization to the child templates
### 3.0.1

@@ -12,0 +16,0 @@

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