Socket
Socket
Sign inDemoInstall

prefix

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prefix - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

39

index.js

@@ -17,5 +17,5 @@

module.exports = exports = function(key){
return key in memo
? memo[key]
: memo[key] = prefix(key)
return key in memo
? memo[key]
: memo[key] = prefix(key)
}

@@ -37,18 +37,23 @@

function prefix(key){
// without prefix
if (style[key] !== undefined) return key
// camel case
key = key.replace(/-([a-z])/g, function(_, char){
return char.toUpperCase()
})
// with prefix
var Key = capitalize(key)
var i = prefixes.length
while (i--) {
var name = prefixes[i] + Key
if (style[name] !== undefined) return name
}
// without prefix
if (style[key] !== undefined) return key
throw new Error('unable to prefix ' + key)
// with prefix
var Key = capitalize(key)
var i = prefixes.length
while (i--) {
var name = prefixes[i] + Key
if (style[name] !== undefined) return name
}
throw new Error('unable to prefix ' + key)
}
function capitalize(str){
return str.charAt(0).toUpperCase() + str.slice(1)
return str.charAt(0).toUpperCase() + str.slice(1)
}

@@ -65,5 +70,5 @@

function dashedPrefix(key){
key = prefix(key)
if (upper.test(key)) key = '-' + key.replace(upper, '-$1')
return key.toLowerCase()
key = prefix(key)
if (upper.test(key)) key = '-' + key.replace(upper, '-$1')
return key.toLowerCase()
}
{
"name": "prefix",
"version": "0.2.0",
"version": "0.2.1",
"description": "prefix a css attribute",
"dependencies": {},
"repository": {
"type": "git",
"url": "git://github.com/jkroso/prefix.git"
"devDependencies": {
"serve": "jkroso/serve#1.5.1",
"assert": "component/assert",
"mocha": "*"
},
"bugs": {
"url": "https://github.com/jkroso/prefix/issues"
},
"repository": "git://github.com/jkroso/prefix.git",
"bugs": "https://github.com/jkroso/prefix/issues",
"keywords": ["prefix"],

@@ -17,2 +17,2 @@ "author": "Jake Rosoman",

"files": ["index.js"]
}
}
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