hyphenate-style-name
Advanced tools
Comparing version 1.0.0 to 1.0.1
11
index.js
'use strict'; | ||
var uppercasePattern = /([A-Z])/g; | ||
var uppercasePattern = /[A-Z]/g; | ||
var msPattern = /^ms-/; | ||
function hyphenateStyleName(string) { | ||
return hyphenate(string).replace(msPattern, '-ms-'); | ||
return string | ||
.replace(uppercasePattern, '-$&') | ||
.toLowerCase() | ||
.replace(msPattern, '-ms-'); | ||
} | ||
function hyphenate(string) { | ||
return string.replace(uppercasePattern, '-$1').toLowerCase(); | ||
} | ||
module.exports = hyphenateStyleName; |
{ | ||
"name": "hyphenate-style-name", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Hyphenates a camelcased CSS property name", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,3 +9,3 @@ # hyphenate-style-name | ||
- `MozTransition` => `-moz-transition` | ||
- `msTransition` => `-ms-transition'` | ||
- `msTransition` => `-ms-transition` | ||
- `color` => `color` | ||
@@ -12,0 +12,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a 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
3855
2