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

postcss-local-constants

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-local-constants - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

3

CHANGELOG.md

@@ -0,1 +1,4 @@

## 0.0.6
* Referencing module paths is now the same as a `require` - it's relative to the current directory.
## 0.0.5

@@ -2,0 +5,0 @@ * `lodash` is used directly rather than `lodash-node`

9

index.js
var postcss = require('postcss');
var nodepath = require('path');
var assign = require('lodash/object/assign');
var resolve = require('resolve');

@@ -11,5 +12,7 @@ module.exports = postcss.plugin('postcss-local-constants', function (opts) {

var getConstants = function(name, path) {
var getConstants = function(name, path, directory) {
var res = resolve.sync(JSON.parse(path), { basedir: nodepath.dirname(directory) });
var requiredSet = name.replace(/~/g, '');
var constantSets = require(nodepath.resolve('./', JSON.parse(path)));
var constantSets = require(res);
if (constantSets[requiredSet]) {

@@ -64,3 +67,3 @@ if (sets[requiredSet]) {

if (node.prop && node.prop.indexOf('~') > -1) {
getConstants(node.prop, node.value);
getConstants(node.prop, node.value, node.source.input.from);
node.removeSelf();

@@ -67,0 +70,0 @@ }

{
"name": "postcss-local-constants",
"version": "0.0.5",
"version": "0.0.6",
"description": "PostCSS plugin to process imported constants from a file, removing them from a global scope.",

@@ -25,3 +25,4 @@ "keywords": [

"lodash": "^3.10.0",
"postcss": "^4.1.13"
"postcss": "^4.1.13",
"resolve": "^1.1.6"
},

@@ -28,0 +29,0 @@ "devDependencies": {

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