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

postcss-import-ext-glob

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-import-ext-glob - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

4

CHANGELOG.md

@@ -6,2 +6,6 @@ # Change Log

## 2.1.0 - 2022-11-30
### Added
- Adds the possibility to define layer parameters to the import rule, thanks to @argyleink. See issue #3
## 2.0.1 - 2021-01-31

@@ -8,0 +12,0 @@ ### Fixed

@@ -22,2 +22,3 @@ const valueParser = require('postcss-value-parser');

const globList = [];
const layer = new Map();

@@ -37,2 +38,5 @@ const params = valueParser(rule.params).nodes;

}
if (param.type === 'function' && param.value === 'layer') {
layer.set(dirName, param.nodes[0].value);
}
}

@@ -51,6 +55,10 @@

sortedEntries.forEach((entry) => {
const paramValue = layer.get(dirName)
? `"${entry}" layer(${layer.get(dirName)})`
: `"${entry}"`;
rule.before(
new AtRule({
name: 'import',
params: `"${entry}"`,
params: paramValue,
source: rule.source,

@@ -57,0 +65,0 @@ })

2

package.json
{
"name": "postcss-import-ext-glob",
"version": "2.0.1",
"version": "2.1.0",
"description": "A PostCSS plugin to extend postcss-import path resolver to allow glob usage as path",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -172,1 +172,14 @@ const test = require('ava');

});
test('layer test', async (t) => {
const input = `
@import-glob "fixtures/css/foo/**/*.css" layer(test);
`;
const output = `
@import "${__dirname}/fixtures/css/foo/bar.css" layer(test);
@import "${__dirname}/fixtures/css/foo/foo.css" layer(test);
`;
await tester.test(input, output, t);
});
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