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

@podium/utils

Package Overview
Dependencies
Maintainers
0
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 5.3.0 to 5.3.1

7

CHANGELOG.md

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

## [5.3.1](https://github.com/podium-lib/utils/compare/v5.3.0...v5.3.1) (2024-09-22)
### Bug Fixes
* receive and emit hinted assets ([a07e0e3](https://github.com/podium-lib/utils/commit/a07e0e3b69d0a372d20417d9410bd50698c9af19))
# [5.3.0](https://github.com/podium-lib/utils/compare/v5.2.1...v5.3.0) (2024-09-20)

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

12

lib/hints.js

@@ -5,3 +5,3 @@ import { EventEmitter } from 'node:events';

#expectedHints = new Set();
#receivedHints = new Set();
#receivedHints = new Map();

@@ -27,7 +27,11 @@ // pointless constructor with super to appease TS which cryptically errors otherwise.

* @param {string} name - The name of the hint
* @param {{js: Array<import('./asset-js.js').JavaScriptAsset | string>, css: Array<import('./asset-css.js').CssAsset | string>}} assets - The hinted assets for a given resource
*/
addReceivedHint(name) {
this.#receivedHints.add(name);
addReceivedHint(name, assets = { js: [], css: [] }) {
this.#receivedHints.set(name, assets);
if (this.allHintsReceived) {
this.emit('complete');
const assets = Array.from(this.#receivedHints.values());
const js = assets.flatMap(({ js = [] }) => js).filter(Boolean);
const css = assets.flatMap(({ css = [] }) => css).filter(Boolean);
this.emit('complete', { js, css });
}

@@ -34,0 +38,0 @@ }

{
"name": "@podium/utils",
"version": "5.3.0",
"version": "5.3.1",
"description": "Common generic utility methods shared by @podium modules.",

@@ -5,0 +5,0 @@ "type": "module",

@@ -14,4 +14,8 @@ export class Hints extends EventEmitter<[never]> {

* @param {string} name - The name of the hint
* @param {{js: Array<import('./asset-js.js').JavaScriptAsset | string>, css: Array<import('./asset-css.js').CssAsset | string>}} assets - The hinted assets for a given resource
*/
addReceivedHint(name: string): void;
addReceivedHint(name: string, assets?: {
js: Array<import("./asset-js.js").JavaScriptAsset | string>;
css: Array<import("./asset-css.js").CssAsset | string>;
}): void;
/**

@@ -18,0 +22,0 @@ * Value will be true if all expected hints have been received

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