New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sticky-module

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sticky-module - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

types/index.d.ts

5

cjs/index.js

@@ -5,6 +5,7 @@ 'use strict';

* if the module might have been re-bundled in other projects.
* @template T
* @param {string} name the module name to save or retrieve
* @param {object} value the module as value to save if not known
* @param {T} value the module as value to save if not known
* @param {globalThis} [global=globalThis] the reference where modules are saved where `globalThis` is the default
* @returns {[object, boolean]} the passed `value` or the previous one as first entry, a boolean indicating if it was known or not
* @returns {[T, boolean]} the passed `value` or the previous one as first entry, a boolean indicating if it was known or not
*/

@@ -11,0 +12,0 @@ const stickyModule = (name, value, global = globalThis) => {

/**
* Allow leaking a module globally to help avoid conflicting exports
* if the module might have been re-bundled in other projects.
* @template T
* @param {string} name the module name to save or retrieve
* @param {object} value the module as value to save if not known
* @param {T} value the module as value to save if not known
* @param {globalThis} [global=globalThis] the reference where modules are saved where `globalThis` is the default
* @returns {[object, boolean]} the passed `value` or the previous one as first entry, a boolean indicating if it was known or not
* @returns {[T, boolean]} the passed `value` or the previous one as first entry, a boolean indicating if it was known or not
*/

@@ -9,0 +10,0 @@ const stickyModule = (name, value, global = globalThis) => {

/**
* Allow leaking a module globally to help avoid conflicting exports
* if the module might have been re-bundled in other projects.
* @template T
* @param {string} name the module name to save or retrieve
* @param {object} value the module as value to save if not known
* @param {T} value the module as value to save if not known
* @param {globalThis} [global=globalThis] the reference where modules are saved where `globalThis` is the default
* @returns {[object, boolean]} the passed `value` or the previous one as first entry, a boolean indicating if it was known or not
* @returns {[T, boolean]} the passed `value` or the previous one as first entry, a boolean indicating if it was known or not
*/

@@ -9,0 +10,0 @@ const stickyModule = (name, value, global = globalThis) => {

16

package.json
{
"name": "sticky-module",
"version": "0.1.0",
"version": "0.1.1",
"description": "A Symbol based leaky utility to store or retrieve a module",
"main": "./cjs/index.js",
"scripts": {
"build": "npm run cjs && npm run rollup:es && npm run rollup:index && npm run test",
"build": "npm run cjs && npm run rollup:es && npm run rollup:index && npm run ts && npm run test",
"cjs": "ascjs --no-default esm cjs",
"rollup:es": "rollup --config rollup/es.config.js && sed -i.bck 's/^var /self./' es.js && rm -rf es.js.bck",
"rollup:index": "rollup --config rollup/index.config.js",
"coveralls": "c8 report --reporter=text-lcov | coveralls",
"test": "c8 node test/index.js"
"test": "c8 node test/index.js",
"ts": "tsc -p .",
"coverage": "mkdir -p ./coverage; c8 report --reporter=text-lcov > ./coverage/lcov.info"
},

@@ -23,6 +24,6 @@ "keywords": [

"@rollup/plugin-terser": "^0.4.4",
"ascjs": "^6.0.2",
"ascjs": "^6.0.3",
"c8": "^8.0.1",
"coveralls": "^3.1.1",
"rollup": "^4.0.2"
"rollup": "^4.3.0",
"typescript": "^5.2.2"
},

@@ -33,2 +34,3 @@ "module": "./esm/index.js",

".": {
"types": "./types/index.d.ts",
"import": "./esm/index.js",

@@ -35,0 +37,0 @@ "default": "./cjs/index.js"

# sticky-module
[![build status](https://github.com/WebReflection/sticky-module/actions/workflows/node.js.yml/badge.svg)](https://github.com/WebReflection/sticky-module/actions) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/sticky-module/badge.svg?branch=main)](https://coveralls.io/github/WebReflection/sticky-module?branch=main)
A Symbol based leaky utility to store or retrieve a module, so that libraries can actually be sure if these are re-bundled elsewhere they still work as expected or do not bootstrap twice.

@@ -20,3 +22,3 @@

a: Math.random(),
b: 'let it'
b: 'nope, already there'
});

@@ -23,0 +25,0 @@

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