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

icss-utils

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

icss-utils - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

18

lib/extractICSS.js

@@ -1,2 +0,2 @@

'use strict';
"use strict";

@@ -17,7 +17,9 @@ Object.defineProperty(exports, "__esModule", {

var extractICSS = function extractICSS(css) {
var removeRules = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var icssImports = {};
var icssExports = {};
css.each(function (node) {
if (node.type === 'rule') {
if (node.selector.slice(0, 7) === ':import') {
if (node.type === "rule") {
if (node.selector.slice(0, 7) === ":import") {
var matches = importPattern.exec(node.selector);

@@ -28,8 +30,12 @@ if (matches) {

icssImports[path] = aliases;
node.remove();
if (removeRules) {
node.remove();
}
}
}
if (node.selector === ':export') {
if (node.selector === ":export") {
Object.assign(icssExports, getDeclsObject(node));
node.remove();
if (removeRules) {
node.remove();
}
}

@@ -36,0 +42,0 @@ }

{
"name": "icss-utils",
"version": "2.0.0",
"version": "2.1.0",
"description": "ICSS utils for postcss ast",

@@ -13,10 +13,18 @@ "main": "lib/index.js",

"precommit": "lint-staged",
"prepublish": "yarn run test && yarn run build"
"prepublish": "yarn test && yarn run build"
},
"lint-staged": {
"*.js": [
"prettier --single-quote --no-semi --write",
"eslint",
"prettier --write",
"git add"
]
},
"eslintConfig": {
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"extends": "eslint:recommended"
},
"babel": {

@@ -36,3 +44,3 @@ "presets": [

"type": "git",
"url": "git+https://github.com/css-modules/icss-replace-symbols.git"
"url": "git+https://github.com/css-modules/icss-utils.git"
},

@@ -48,5 +56,5 @@ "keywords": [

"bugs": {
"url": "https://github.com/css-modules/icss-replace-symbols/issues"
"url": "https://github.com/css-modules/icss-utils/issues"
},
"homepage": "https://github.com/css-modules/icss-replace-symbols#readme",
"homepage": "https://github.com/css-modules/icss-utils#readme",
"dependencies": {

@@ -59,2 +67,3 @@ "postcss": "^6.0.1"

"babel-preset-env": "^1.5.1",
"eslint": "^3.19.0",
"husky": "^0.13.3",

@@ -61,0 +70,0 @@ "jest": "^20.0.3",

@@ -28,5 +28,5 @@ [![Build Status](https://travis-ci.org/css-modules/icss-utils.svg)](https://travis-ci.org/css-modules/icss-utils)

## extractICSS(css)
## extractICSS(css, removeRules = true)
Extracts and remove from PostCSS tree `:import` and `:export` statements.
Extracts and remove (if removeRules is equal true) from PostCSS tree `:import` and `:export` statements.

@@ -33,0 +33,0 @@ ```js

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