Socket
Socket
Sign inDemoInstall

@muil/templates-renderer

Package Overview
Dependencies
Maintainers
3
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@muil/templates-renderer - npm Package Compare versions

Comparing version 1.5.3 to 1.5.4

6

package.json
{
"name": "@muil/templates-renderer",
"version": "1.5.3",
"version": "1.5.4",
"license": "MIT",

@@ -24,3 +24,3 @@ "main": "src/index.js",

"uuid": "^8.3.1",
"vm2": "3.9.17"
"vm2": "3.9.19"
},

@@ -38,3 +38,3 @@ "peerDependencies": {

},
"gitHead": "ce3b36f9a37366fa85a9fe83120ee9421960793d"
"gitHead": "44c1d31698cb6988b295e7b5c660b62f4e173338"
}

@@ -1,2 +0,2 @@

type Options = {
declare type Options = {
css?: string;

@@ -3,0 +3,0 @@ styles?: string;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {

@@ -10,0 +6,0 @@ if (k2 === undefined) k2 = k;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {

@@ -48,3 +44,3 @@ if (k2 === undefined) k2 = k;

});
const tempFileName = `./.muil/temp/${(0, uuid_1.v4)()}.js`;
const tempFileName = `./.muil/temp/${uuid_1.v4()}.js`;
await fs.promises.mkdir('./.muil/temp', { recursive: true });

@@ -88,3 +84,3 @@ await fs.promises.copyFile(templatePath, tempFileName);

: null;
let html = (0, emailTemplate_1.default)({
let html = emailTemplate_1.default({
css: templateCss,

@@ -96,3 +92,3 @@ styles: (await Promise.all(styleCollectors.map((collector) => collector(ReactElement)))).join('\n'),

if (type === 'html' && inlineCss) {
html = (0, juice_1.default)(html);
html = juice_1.default(html);
}

@@ -103,3 +99,3 @@ html = he_1.default.encode(html.toString(), {

if (minifyHtml) {
html = (0, html_minifier_1.minify)(html, {
html = html_minifier_1.minify(html, {
preventAttributesEscaping: true,

@@ -114,6 +110,6 @@ minifyCSS: true,

case 'png': {
return (0, puppeteer_1.generatePng)(html);
return puppeteer_1.generatePng(html);
}
case 'pdf': {
return (0, puppeteer_1.generatePdf)(html, pdfFormat, pdfOrientation);
return puppeteer_1.generatePdf(html, pdfFormat, pdfOrientation);
}

@@ -120,0 +116,0 @@ default: {

@@ -15,3 +15,3 @@ "use strict";

TemplatesRendererModule = __decorate([
(0, common_1.Module)({
common_1.Module({
providers: [templates_renderer_service_1.TemplatesRendererService],

@@ -18,0 +18,0 @@ exports: [templates_renderer_service_1.TemplatesRendererService],

@@ -17,3 +17,3 @@ "use strict";

async render({ type = 'html', templatePath, templateCssPath = null, props = {}, shadowSupport = false, inlineCss = true, minifyHtml = true, pdfFormat = 'a4', pdfOrientation = 'portrait', }) {
return (0, renderTemplate_1.default)({
return renderTemplate_1.default({
type,

@@ -32,5 +32,5 @@ templatePath,

TemplatesRendererService = __decorate([
(0, common_1.Injectable)()
common_1.Injectable()
], TemplatesRendererService);
exports.TemplatesRendererService = TemplatesRendererService;
//# sourceMappingURL=templates-renderer.service.js.map
import { PaperFormat } from 'puppeteer-core';
export type RenderOptions = {
export declare type RenderOptions = {
type?: 'html' | 'png' | 'pdf';

@@ -4,0 +4,0 @@ templatePath: string;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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