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

@podium/utils

Package Overview
Dependencies
Maintainers
5
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@podium/utils - npm Package Compare versions

Comparing version 4.0.0-next.3 to 4.0.0-next.4

lib/html-document.js

48

lib/utils.js

@@ -6,2 +6,3 @@ 'use strict';

const HttpIncoming = require('./http-incoming');
const document = require('./html-document');

@@ -241,47 +242,2 @@ /**

/**
* Shared template function for use in layout and podlet
*
* @param {Object} data template argument object
*
* @returns {String} A merged template string
*/
const template = ({
head = '',
body = '',
encoding = 'utf-8',
locale = 'en-US',
title = '',
js = [],
css = [],
} = {}) => {
let scripts = js;
let styles = css;
const buildScriptTag = ({ value = '' }) =>
`<script src="${value}" defer></script>`;
const buildCSSLinkTag = ({ value = '' }) =>
`<link rel="stylesheet" type="text/css" href="${value}">`;
// backwards compatibility for scripts and styles
if (typeof js === 'string') scripts = [{ type: 'default', value: js }];
if (typeof css === 'string') styles = [{ type: 'default', value: css }];
return `<!doctype html>
<html lang="${locale}">
<head>
<meta charset="${encoding}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
${styles.map(buildCSSLinkTag).join('\n ')}
${scripts.map(buildScriptTag).join('\n ')}
<title>${title}</title>
${head}
</head>
<body>
${body}
</body>
</html>`;
};
module.exports.isString = isString;

@@ -299,2 +255,2 @@ module.exports.isFunction = isFunction;

module.exports.HttpIncoming = HttpIncoming;
module.exports.template = template;
module.exports.template = document;
{
"name": "@podium/utils",
"version": "4.0.0-next.3",
"version": "4.0.0-next.4",
"description": "Common generic utility methods shared by @podium modules.",

@@ -5,0 +5,0 @@ "license": "MIT",

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