Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.2 to 1.0.3

.nyc_output/f0abf84f-70c3-425c-9716-c5605115059e.json

27

index.js

@@ -1,16 +0,19 @@

'use strict';
/* eslint-disable no-var, prefer-template */
var uppercasePattern = /[A-Z]/g
var msPattern = /^ms-/
var cache = {}
var uppercasePattern = /[A-Z]/g;
var msPattern = /^ms-/;
var cache = {};
function toHyphenLower(match) {
return '-' + match.toLowerCase()
}
function hyphenateStyleName(string) {
return string in cache
? cache[string]
: cache[string] = string
.replace(uppercasePattern, '-$&')
.toLowerCase()
.replace(msPattern, '-ms-');
function hyphenateStyleName(name) {
if (cache.hasOwnProperty(name)) {
return cache[name]
}
var hName = name.replace(uppercasePattern, toHyphenLower)
return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)
}
module.exports = hyphenateStyleName;
export default hyphenateStyleName
{
"name": "hyphenate-style-name",
"version": "1.0.2",
"version": "1.0.3",
"description": "Hyphenates a camelcased CSS property name",
"main": "index.js",
"main": "index.cjs.js",
"module": "index.js",
"scripts": {
"build": "rollup --input index.js --file index.cjs.js --format cjs",
"coverage": "nyc tape -- test/**/*.test.js",
"lint": "eslint .",
"lint": "eslint . --ignore-path .gitignore",
"test": "tape test/**/*.test.js",
"pretest": "npm run lint"
"precoverage": "npm run build",
"pretest": "npm run lint && npm run build",
"prepublishOnly": "npm run build"
},

@@ -29,7 +33,10 @@ "repository": {

"devDependencies": {
"eslint": "^3.8.1",
"eslint-config-vaffel": "^5.0.0",
"nyc": "^8.3.2",
"eslint": "^4.6.0",
"eslint-config-prettier": "^3.3.0",
"eslint-config-sanity": "^0.140.0",
"nyc": "^13.1.0",
"prettier": "^1.15.2",
"rollup": "^1.1.2",
"tape": "^4.6.2"
}
}
# hyphenate-style-name
[![npm version](http://img.shields.io/npm/v/hyphenate-style-name.svg?style=flat-square)](http://browsenpm.org/package/hyphenate-style-name)[![Build Status](http://img.shields.io/travis/rexxars/hyphenate-style-name/master.svg?style=flat-square)](https://travis-ci.org/rexxars/hyphenate-style-name)[![Coverage Status](http://img.shields.io/codeclimate/coverage/github/rexxars/hyphenate-style-name.svg?style=flat-square)](https://codeclimate.com/github/rexxars/hyphenate-style-name)[![Code Climate](http://img.shields.io/codeclimate/github/rexxars/hyphenate-style-name.svg?style=flat-square)](https://codeclimate.com/github/rexxars/hyphenate-style-name/)
[![npm version](http://img.shields.io/npm/v/hyphenate-style-name.svg?style=flat-square)](http://browsenpm.org/package/hyphenate-style-name)[![Build Status](http://img.shields.io/travis/rexxars/hyphenate-style-name/master.svg?style=flat-square)](https://travis-ci.org/rexxars/hyphenate-style-name)

@@ -21,5 +21,5 @@ Hyphenates a camelcased CSS property name. For example:

```js
var hyphenateStyleName = require('hyphenate-style-name');
var hyphenateStyleName = require('hyphenate-style-name')
console.log(hyphenateStyleName('MozTransition')); // -moz-transition
console.log(hyphenateStyleName('MozTransition')) // -moz-transition
```

@@ -26,0 +26,0 @@

Sorry, the diff of this file is not supported yet

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