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

@podium/utils

Package Overview
Dependencies
Maintainers
6
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.5.0 to 4.5.1

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [4.5.1](https://github.com/podium-lib/utils/compare/v4.5.0...v4.5.1) (2023-11-19)
### Bug Fixes
* correctly build lazy load script tag html when asset strategy is lazy ([b1b2646](https://github.com/podium-lib/utils/commit/b1b264678fdd463eec009216a7119af1ea706ba1))
# [4.5.0](https://github.com/podium-lib/utils/compare/v4.4.42...v4.5.0) (2023-11-16)

@@ -2,0 +9,0 @@

12

lib/html-utils.js

@@ -15,5 +15,9 @@ /* eslint-disable no-restricted-syntax */

const args = [];
args.push({ key: 'src', value: obj.value });
// lazy uses dynamic import in the script body, everything else uses the src attribute
if (obj.strategy !== 'lazy') {
args.push({ key: 'src', value: obj.value });
}
if (obj.type === 'esm' || obj.type === 'module') {
// ESM and module are valid "module" types. Lazy requires type="module" so we set it here.
if (obj.type === 'esm' || obj.type === 'module' || obj.strategy === 'lazy') {
args.push({ key: 'type', value: 'module' });

@@ -47,3 +51,3 @@ }

if (Array.isArray(obj.data) && (obj.data.length !== 0)) {
if (Array.isArray(obj.data) && obj.data.length !== 0) {
obj.data.forEach((item) => {

@@ -74,3 +78,3 @@ args.push({ key: `data-${item.key}`, value: item.value });

})
return `<script ${attrs.join(' ')}></script>`;
return `<script ${attrs.join(' ')}>${obj.strategy === 'lazy' ? `import("${obj.value}");` : ''}</script>`;
};

@@ -77,0 +81,0 @@

{
"name": "@podium/utils",
"version": "4.5.0",
"version": "4.5.1",
"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