Installations
npm install reduce-css-calc
Score
98.7
Supply Chain
93
Quality
76
Maintenance
100
Vulnerability
100
License
Developer
MoOx
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
14.7.0
NPM Version
6.14.7
Statistics
55 Stars
115 Commits
15 Forks
7 Watching
5 Branches
13 Contributors
Updated on 03 Jul 2024
Languages
JavaScript (79.36%)
Yacc (20.64%)
Total Downloads
Cumulative downloads
Total Downloads
922,724,046
Last day
-10.5%
367,014
Compared to previous day
Last week
2.1%
2,184,824
Compared to previous week
Last month
10%
9,025,661
Compared to previous month
Last year
-20.9%
106,137,134
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
reduce-css-calc
Reduce CSS calc() function to the maximum.
Particularly useful for packages like rework-calc or postcss-calc.
Installation
1npm install reduce-css-calc
Usage
var reducedString = reduceCSSCalc(string, precision)
1var reduceCSSCalc = require("reduce-css-calc"); 2 3reduceCSSCalc("calc(1 + 1)"); 4// 2 5 6reduceCSSCalc("calc((6 / 2) - (4 * 2) + 1)"); 7// -4 8 9reduceCSSCalc("calc(1/3)"); 10// 0.33333 11 12reduceCSSCalc("calc(1/3)", 10); 13// 0.3333333333 14 15reduceCSSCalc("calc(3rem * 2 - 1rem)"); 16// 5rem 17 18reduceCSSCalc("calc(2 * 50%)"); 19// 100% 20 21reduceCSSCalc("calc(120% * 50%)"); 22// 60% 23 24reduceCSSCalc("a calc(1 + 1) b calc(1 - 1) c"); 25// a 2 b 0 c 26 27reduceCSSCalc("calc(calc(calc(1rem * 0.75) * 1.5) - 1rem)"); 28// 0.125rem 29 30reduceCSSCalc("calc(calc(calc(1rem * 0.75) * 1.5) - 1px)"); 31// calc(1.125rem - 1px) 32 33reduceCSSCalc("-moz-calc(100px / 2)"); 34// 50px 35 36reduceCSSCalc("-moz-calc(50% - 2em)"); 37// -moz-calc(50% - 2em)
See unit tests for others examples.
Contributing
Work on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature.
1git clone https://github.com/MoOx/reduce-css-calc.git 2git checkout -b patch-1 3npm install 4npm test
Changelog
License
Security contact information
To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.
Stable Version
The latest stable version of the package.
Stable Version
2.1.8
CRITICAL
1
0/10
Summary
Arbitrary Code Injection in reduce-css-calc
Affected Versions
< 1.2.5
Patched Versions
1.2.5
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 5/25 approved changesets -- score normalized to 2
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/MoOx/reduce-css-calc/build.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/MoOx/reduce-css-calc/build.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/MoOx/reduce-css-calc/build.yml/main?enable=pin
- Info: 0 out of 3 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 1 npmCommand dependencies pinned
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/build.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 10 are checked with a SAST tool
Reason
40 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-6chw-6frg-f759
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx
- Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm
- Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h
- Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3
- Warn: Project is vulnerable to: MAL-2023-462
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-282f-qqgm-c34q
- Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6
- Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
2.8
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More