Socket
Socket
Sign inDemoInstall

hyphenate-style-name

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyphenate-style-name - npm Package Compare versions

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 @@

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