Comparing version 3.4.1 to 3.5.0
12
index.js
@@ -6,2 +6,3 @@ var _ = require('lodash') | ||
var gzipSize = require('gzip-size') | ||
var size = require('./lib/size') | ||
@@ -13,3 +14,3 @@ var rules = require('./lib/rules') | ||
module.exports = function(src, opts) { | ||
module.exports = function (src, opts) { | ||
opts = opts || {} | ||
@@ -24,3 +25,3 @@ opts = _.defaults(opts, { | ||
propertyResets: false, | ||
vendorPrefixedProperties: false | ||
vendorPrefixedProperties: false, | ||
}) | ||
@@ -47,7 +48,7 @@ | ||
plugin: 'postcss-cssstats', | ||
stats: stats | ||
stats: stats, | ||
}) | ||
} | ||
stats.toJSON = function() { | ||
stats.toJSON = function () { | ||
// Remove methods when using JSON.stringify | ||
@@ -72,3 +73,4 @@ delete stats.selectors.getSpecificityGraph | ||
// Default behavior | ||
var root = postcss().process(src, { parser: safeParser }).root | ||
var root = postcss([]).process(src, { parser: safeParser, from: undefined }) | ||
.root | ||
var result = parse(root, {}) | ||
@@ -75,0 +77,0 @@ return result |
{ | ||
"name": "cssstats", | ||
"version": "3.4.1", | ||
"version": "3.5.0", | ||
"description": "High-level stats for stylesheets", | ||
@@ -8,3 +8,3 @@ "main": "index.js", | ||
"license": "MIT", | ||
"repository": "cssstats/cssstats-core", | ||
"repository": "cssstats/cssstats", | ||
"keywords": [ | ||
@@ -17,28 +17,21 @@ "CSS", | ||
"dependencies": { | ||
"bytes": "^3.0.0", | ||
"css-selector-tokenizer": "^0.7.0", | ||
"css-shorthand-expand": "^1.1.0", | ||
"gzip-size": "^4.1.0", | ||
"has-class-selector": "^3.3.1", | ||
"has-element-selector": "^3.3.1", | ||
"has-id-selector": "^3.3.1", | ||
"has-pseudo-class": "^3.3.1", | ||
"has-pseudo-element": "^3.3.1", | ||
"bytes": "^3.1.0", | ||
"css-selector-tokenizer": "^0.7.3", | ||
"css-shorthand-expand": "^1.2.0", | ||
"gzip-size": "^5.1.1", | ||
"has-class-selector": "^3.5.0", | ||
"has-element-selector": "^3.5.0", | ||
"has-id-selector": "^3.5.0", | ||
"has-pseudo-class": "^3.5.0", | ||
"has-pseudo-element": "^3.5.0", | ||
"is-blank": "^2.1.0", | ||
"is-css-shorthand": "^1.0.1", | ||
"is-present": "^1.0.0", | ||
"is-vendor-prefixed": "^3.3.1", | ||
"lodash": "^4.17.5", | ||
"postcss": "^6.0.21", | ||
"postcss-safe-parser": "^3.0.1", | ||
"specificity": "^0.3.2" | ||
"is-vendor-prefixed": "^3.5.0", | ||
"lodash": "^4.17.20", | ||
"postcss": "^8.1.4", | ||
"postcss-safe-parser": "^5.0.2", | ||
"specificity": "^0.4.1" | ||
}, | ||
"devDependencies": { | ||
"get-css": "^3.4.1", | ||
"mocha": "^5.0.5" | ||
}, | ||
"scripts": { | ||
"test": "rm -rf test/results && mkdir test/results && mocha test" | ||
}, | ||
"gitHead": "24602286cb10123ec6286404c89af5105763733d" | ||
"gitHead": "dddf9c82cec12c909947f89d551fa86a74e90dba" | ||
} |
@@ -1,2 +0,2 @@ | ||
# cssstats [![Build Status](https://travis-ci.org/cssstats/core.svg?branch=master)](https://travis-ci.org/cssstats/core) | ||
# cssstats | ||
@@ -38,4 +38,4 @@ Parses stylesheets and returns an object with statistics. | ||
.process(css) | ||
.then(function(result) { | ||
result.messages.forEach(function(message) { | ||
.then(function (result) { | ||
result.messages.forEach(function (message) { | ||
console.log(message) | ||
@@ -42,0 +42,0 @@ }) |
@@ -78,3 +78,3 @@ { | ||
"selectors": { | ||
"total": 13, | ||
"total": 11, | ||
"type": 1, | ||
@@ -95,4 +95,2 @@ "class": 9, | ||
".box:last-child", | ||
"0%", | ||
"100%", | ||
"header", | ||
@@ -103,3 +101,3 @@ ".georgia" | ||
"max": 100, | ||
"average": 18 | ||
"average": 21.09090909090909 | ||
} | ||
@@ -106,0 +104,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
1483290
0
44
9955
3
2
+ Addedgzip-size@5.1.1(transitive)
+ Addednanoid@3.3.7(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpify@4.0.1(transitive)
+ Addedpostcss@8.4.47(transitive)
+ Addedpostcss-safe-parser@5.0.2(transitive)
+ Addedsource-map-js@1.2.1(transitive)
+ Addedspecificity@0.4.1(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedgzip-size@4.1.0(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedpify@3.0.0(transitive)
- Removedpostcss@6.0.23(transitive)
- Removedpostcss-safe-parser@3.0.1(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedspecificity@0.3.2(transitive)
- Removedsupports-color@5.5.0(transitive)
Updatedbytes@^3.1.0
Updatedcss-shorthand-expand@^1.2.0
Updatedgzip-size@^5.1.1
Updatedhas-class-selector@^3.5.0
Updatedhas-element-selector@^3.5.0
Updatedhas-id-selector@^3.5.0
Updatedhas-pseudo-class@^3.5.0
Updatedhas-pseudo-element@^3.5.0
Updatedis-vendor-prefixed@^3.5.0
Updatedlodash@^4.17.20
Updatedpostcss@^8.1.4
Updatedpostcss-safe-parser@^5.0.2
Updatedspecificity@^0.4.1