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

btrz-pdf

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

btrz-pdf - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

2

package.json
{
"name": "btrz-pdf",
"version": "1.1.0",
"version": "1.2.0",
"description": "Generates pdf documents based on a liquid template",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -131,3 +131,3 @@ const formatter = require("btrz-formatter");

if (ctx && ctx.environments && ctx.environments.providerPreferences && ctx.environments.providerPreferences.preferences &&
ctx.environments[this.item] && ctx.environments[this.item][this.propName]) {
ctx.environments[this.item] && ctx.environments[this.item][this.propName] !== undefined) {
return formatter.money(getCurrencyValue(ctx.environments[this.item], this.propName, ctx.environments.providerPreferences, {prefix: "display"}));

@@ -134,0 +134,0 @@ }

@@ -132,2 +132,25 @@ describe("index.js", () => {

it("should return money even when values is zero", async () => {
const pdf = require("../src/index");
const template = `{
"content": [
"{%- money ticket total -%}",
"{%- curcySymbol ticket -%}",
"{%- curcyIso ticket -%}",
"{%- moneyReduce ticket ssrs subTotal -%}"
]
}`;
data.ticket.total = 0;
data.ticket.ssrs[0].subTotal = 0;
const documentDefinition = await pdf.toDocumentDefinition(template, data);
expect(documentDefinition).to.be.eql({
"content": [
"0.00",
"$",
"CAD",
"31.00",
]
});
});
it("should return a parsed liquidTemplate", async () => {

@@ -134,0 +157,0 @@ const pdf = require("../src/index");

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