Socket
Socket
Sign inDemoInstall

style-mod

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

style-mod - npm Package Compare versions

Comparing version 4.1.0 to 4.1.1

2

package.json
{
"name": "style-mod",
"version": "4.1.0",
"version": "4.1.1",
"description": "A minimal CSS module shim",

@@ -5,0 +5,0 @@ "main": "dist/style-mod.cjs",

@@ -93,11 +93,8 @@ const C = "\u037c"

constructor(root, nonce) {
this.root = root
let doc = root.ownerDocument || root, win = doc.defaultView
if (!root.head && root.adoptedStyleSheets && win.CSSStyleSheet) {
let adopted = adoptedSet.get(doc)
if (adopted) {
root.adoptedStyleSheets = [adopted.sheet, ...root.adoptedStyleSheets]
return root[SET] = adopted
}
if (adopted) return root[SET] = adopted
this.sheet = new win.CSSStyleSheet
root.adoptedStyleSheets = [this.sheet, ...root.adoptedStyleSheets]
adoptedSet.set(doc, this)

@@ -107,4 +104,2 @@ } else {

if (nonce) this.styleTag.setAttribute("nonce", nonce)
let target = root.head || root
target.insertBefore(this.styleTag, target.firstChild)
}

@@ -136,3 +131,6 @@ this.modules = []

if (!sheet) {
if (sheet) {
if (this.root.adoptedStyleSheets.indexOf(this.sheet) < 0)
this.root.adoptedStyleSheets = [this.sheet, ...this.root.adoptedStyleSheets]
} else {
let text = ""

@@ -142,2 +140,5 @@ for (let i = 0; i < this.modules.length; i++)

this.styleTag.textContent = text
let target = this.root.head || this.root
if (this.styleTag.parentNode != target)
target.insertBefore(this.styleTag, target.firstChild)
}

@@ -144,0 +145,0 @@ }

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