idea-html2pdf
Advanced tools
Comparing version 1.3.0 to 1.3.1
/// <reference types="node" /> | ||
import { S3, Lambda } from 'aws-sdk'; | ||
import { SafeString, HelperDelegate } from 'handlebars'; | ||
import * as Handlebars from 'handlebars'; | ||
import { Languages, SignedURL } from 'idea-toolbox'; | ||
@@ -33,7 +33,7 @@ /** | ||
*/ | ||
handlebarsSafeString(str: string): SafeString; | ||
handlebarsSafeString(str: string): Handlebars.SafeString; | ||
/** | ||
* Register an additional handelbars helper. | ||
*/ | ||
handlebarsRegisterHelper(name: string, func: HelperDelegate | any): void; | ||
handlebarsRegisterHelper(name: string, func: Handlebars.HelperDelegate | any): void; | ||
/** | ||
@@ -40,0 +40,0 @@ * Create a new PDF created by an HTML source. |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PDF_TEMPLATE = exports.HTML2PDF = void 0; | ||
const aws_sdk_1 = require("aws-sdk"); | ||
const handlebars_1 = require("handlebars"); | ||
const Handlebars = __importStar(require("handlebars")); | ||
const idea_toolbox_1 = require("idea-toolbox"); | ||
@@ -34,3 +53,3 @@ // declare libs as global vars to be reused in warm starts by the Lambda function | ||
handlebarsCompile(input, options) { | ||
return (0, handlebars_1.compile)(input, options); | ||
return Handlebars.compile(input, options); | ||
} | ||
@@ -41,3 +60,3 @@ /** | ||
handlebarsSafeString(str) { | ||
return new handlebars_1.SafeString(str); | ||
return new Handlebars.SafeString(str); | ||
} | ||
@@ -48,3 +67,3 @@ /** | ||
handlebarsRegisterHelper(name, func) { | ||
(0, handlebars_1.registerHelper)(name, func); | ||
Handlebars.registerHelper(name, func); | ||
} | ||
@@ -136,3 +155,3 @@ /** | ||
const variables = { _template, _data }; | ||
return new handlebars_1.SafeString((0, handlebars_1.compile)(htmlInnerTemplate, { compat: true })(variables)); | ||
return new Handlebars.SafeString(Handlebars.compile(htmlInnerTemplate, { compat: true })(variables)); | ||
}, | ||
@@ -143,3 +162,3 @@ isFieldABoolean: (data, value) => typeof data[value] === 'boolean', | ||
label: (label) => (label ? label[language] || label[languages.default] : null), | ||
mdToHTML: (s) => (typeof s === 'string' ? new handlebars_1.SafeString((0, idea_toolbox_1.mdToHtml)(s)) : s), | ||
mdToHTML: (s) => (typeof s === 'string' ? new Handlebars.SafeString((0, idea_toolbox_1.mdToHtml)(s)) : s), | ||
translate: (s) => s && additionalTranslations && additionalTranslations[s] ? additionalTranslations[s] : s | ||
@@ -146,0 +165,0 @@ }; |
{ | ||
"name": "idea-html2pdf", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "IDEA helper for generating a PDF from HTML contents", | ||
@@ -5,0 +5,0 @@ "engines": { |
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
25943
494