Socket
Socket
Sign inDemoInstall

postcss-modules-local-by-default

Package Overview
Dependencies
9
Maintainers
4
Versions
37
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.1 to 4.0.2

2

package.json
{
"name": "postcss-modules-local-by-default",
"version": "4.0.1",
"version": "4.0.2",
"description": "A CSS Modules transform to make local scope the default",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -305,11 +305,2 @@ "use strict";

function isWordAFunctionArgument(wordNode, functionNode) {
return functionNode
? functionNode.nodes.some(
(functionNodeChild) =>
functionNodeChild.sourceIndex === wordNode.sourceIndex
)
: false;
}
// `none` is special value, other is global values

@@ -377,20 +368,27 @@ const specialKeywords = [

const animationKeywords = {
// animation-direction
$normal: 1,
$reverse: 1,
$alternate: 1,
"$alternate-reverse": 1,
// animation-fill-mode
$forwards: 1,
$backwards: 1,
$both: 1,
// animation-iteration-count
$infinite: 1,
// animation-play-state
$paused: 1,
$running: 1,
// animation-timing-function
$ease: 1,
"$ease-in": 1,
"$ease-out": 1,
"$ease-in-out": 1,
"$ease-out": 1,
$forwards: 1,
$infinite: 1,
$linear: 1,
$none: Infinity, // No matter how many times you write none, it will never be an animation name
$normal: 1,
$paused: 1,
$reverse: 1,
$running: 1,
"$step-end": 1,
"$step-start": 1,
// Special
$none: Infinity, // No matter how many times you write none, it will never be an animation name
// Global values
$initial: Infinity,

@@ -402,23 +400,24 @@ $inherit: Infinity,

};
const didParseAnimationName = false;
let parsedAnimationKeywords = {};
let stepsFunctionNode = null;
const valueNodes = valueParser(declaration.value).walk((node) => {
/* If div-token appeared (represents as comma ','), a possibility of an animation-keywords should be reflesh. */
// If div-token appeared (represents as comma ','), a possibility of an animation-keywords should be reflesh.
if (node.type === "div") {
parsedAnimationKeywords = {};
return;
}
if (node.type === "function" && node.value.toLowerCase() === "steps") {
stepsFunctionNode = node;
// Do not handle nested functions
else if (node.type === "function") {
return false;
}
const value =
node.type === "word" &&
!isWordAFunctionArgument(node, stepsFunctionNode)
? node.value.toLowerCase()
: null;
// Ignore all except word
else if (node.type !== "word") {
return;
}
const value = node.type === "word" ? node.value.toLowerCase() : null;
let shouldParseAnimationName = false;
if (!didParseAnimationName && value && validIdent.test(value)) {
if (value && validIdent.test(value)) {
if ("$" + value in animationKeywords) {

@@ -444,2 +443,3 @@ parsedAnimationKeywords["$" + value] =

};
return localizeDeclNode(node, subContext);

@@ -446,0 +446,0 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc