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 2.2.3 to 2.3.0

2

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

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

@@ -88,2 +88,3 @@ function sym(name, random) {

this.modules = []
root[SET] = this
}

@@ -121,2 +122,10 @@

function extendSelector(template, sel) {
return sel.split(/\s*,\s*/).map(sel => {
let cut = sel.indexOf("/*|*/")
let prefix = cut < 0 ? "" : sel.slice(0, cut + 5)
return prefix + template.replace(/&/g, cut < 0 ? sel : sel.slice(cut + 5))
}).join(", ")
}
function renderStyle(selector, spec, output) {

@@ -131,3 +140,3 @@ if (typeof spec != "object") throw new RangeError("Expected style object, got " + JSON.stringify(spec))

} else if (/&/.test(prop)) {
renderStyle(selector.split(/\s*,\s*/).map(sel => prop.replace(/&/g, sel)).join(", "), spec[prop], output)
renderStyle(extendSelector(prop, selector), spec[prop], output)
} else if (prop != "specificity") {

@@ -134,0 +143,0 @@ if (typeof spec[prop] == "object") throw new RangeError("The value of a property (" + prop + ") should be a primitive value.")

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