Socket
Socket
Sign inDemoInstall

postcss-initial

Package Overview
Dependencies
3
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.2 to 3.0.3

.github/workflows/npm-publish.yml

5

CHANGELOG.md

@@ -5,4 +5,7 @@ # Changelog

### [3.0.2](https://github.com/maximkoretskiy/postcss-initial/compare/v3.0.1...v3.0.2) (2019-10-31)
## [3.0.3] - 2020-07-14
- Update deps
## [3.0.2](https://github.com/maximkoretskiy/postcss-initial/compare/v3.0.1...v3.0.2) (2019-10-31)
## [3.0.1] - 2019-08-09

@@ -9,0 +12,0 @@ - Fix lodash.template vulnerability. See https://github.com/lodash/lodash/pull/4336

2

index.js

@@ -20,3 +20,3 @@ var postcss = require('postcss');

css.walkDecls(function (decl) {
if (decl.value.indexOf('initial') < 0) {
if (!/\binitial\b/.test(decl.value)) {
return;

@@ -23,0 +23,0 @@ }

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

var template = require('lodash.template');
var decls = require('./decls.json');
function template(string, data) {
return string.replace(/\$\{([\w\-\.]*)\}/g, function (_str, key) {
var v = data[key];
return typeof v !== 'undefined' && v !== null ? v : '';
});
}
/*

@@ -26,4 +32,3 @@ Rules legend:

if (decl.combined && decl.initial) {
var t = template(decl.initial.replace(/\-/g, ''));
decl.initial = t(templateVars);
decl.initial = template(decl.initial.replace(/\-/g, ''), templateVars);
}

@@ -37,4 +42,4 @@ return decl;

if (!decl.contains) return map;
return decl.contains.reduce(function (mapInner, dependensy) {
mapInner[dependensy] = decl;
return decl.contains.reduce(function (mapInner, dependency) {
mapInner[dependency] = decl;
return mapInner;

@@ -51,7 +56,7 @@ }, map);

}).map(function (decl) {
var dependensy = requiredMap[decl.prop];
if (dependensy) {
decl.requiredBy = dependensy.prop;
decl.basic = decl.basic || dependensy.basic;
decl.inherited = decl.inherited || dependensy.inherited;
var dependency = requiredMap[decl.prop];
if (dependency) {
decl.requiredBy = dependency.prop;
decl.basic = decl.basic || dependency.basic;
decl.inherited = decl.inherited || dependency.inherited;
}

@@ -68,3 +73,3 @@ return decl;

prop: rule.prop,
value: value.replace(/initial/g, rule.initial)
value: value.replace(/\binitial\b/g, rule.initial)
};

@@ -71,0 +76,0 @@ });

{
"name": "postcss-initial",
"version": "3.0.2",
"version": "3.0.3",
"description": "PostCSS plugin to fallback initial keyword.",

@@ -18,3 +18,2 @@ "keywords": [

"dependencies": {
"lodash.template": "^4.5.0",
"postcss": "^7.0.2"

@@ -27,3 +26,3 @@ },

"husky": "^3.0.9",
"standard-version": "^7.0.0"
"standard-version": "^8.0.1"
},

@@ -38,4 +37,4 @@ "scripts": {

"hooks": {
"pre-commit": "yarn test",
"pre-push": "yarn test"
"pre-commit": "npm test",
"pre-push": "npm test"
}

@@ -45,5 +44,5 @@ },

"scripts": {
"prerelease": "yarn test"
"prerelease": "npm test"
}
}
}

@@ -52,2 +52,4 @@ # PostCSS Initial

[!['Can I use' table](https://caniuse.bitsofco.de/image/css-initial-value.png)](https://caniuse.com/#feat=css-initial-value)
**Killer feature!**

@@ -54,0 +56,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