Comparing version 1.0.1 to 1.0.2
@@ -14,3 +14,3 @@ 'use strict'; | ||
function longer (a, b) { | ||
function shorter (a, b) { | ||
return (a && a.length < b.length ? a : b).toLowerCase(); | ||
@@ -40,3 +40,3 @@ } | ||
})[0]; | ||
return longer(keyword, colour); | ||
return shorter(keyword, colour); | ||
} else if (ctype.isKeyword(colour)) { | ||
@@ -46,3 +46,3 @@ var hex = colourNames[filterColours(function (key) { | ||
})[0]]; | ||
return longer(hex, colour); | ||
return shorter(hex, colour); | ||
} | ||
@@ -49,0 +49,0 @@ // Possibly malformed, just pass through |
'use strict'; | ||
module.exports = function trimLeadingZero (str) { | ||
return str.replace(/0(\.\d*)/g, '$1'); | ||
return str.replace(/([^\d])0(\.\d*)/g, '$1$2'); | ||
}; |
{ | ||
"name": "colormin", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Turn a CSS color into its smallest representation.", | ||
@@ -19,3 +19,3 @@ "main": "index.js", | ||
"name": "Ben Briggs", | ||
"email": "therealbenbriggs@hotmail.com", | ||
"email": "beneb.info@gmail.com", | ||
"url": "http://beneb.info" | ||
@@ -25,12 +25,9 @@ }, | ||
"dependencies": { | ||
"color": "^0.8.0", | ||
"color": "^0.9.0", | ||
"css-color-names": "0.0.1" | ||
}, | ||
"devDependencies": { | ||
"tape": "^3.5.0" | ||
"tape": "^4.0.0" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/ben-eb/colormin.git" | ||
} | ||
"repository": "ben-eb/colormin" | ||
} |
@@ -5,4 +5,6 @@ # colormin [![Build Status](https://travis-ci.org/ben-eb/colormin.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/colormin.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/colormin.svg)][deps] | ||
Install via [npm](https://npmjs.org/package/colormin): | ||
## Install | ||
With [npm](https://npmjs.org/package/colormin) do: | ||
``` | ||
@@ -32,3 +34,3 @@ npm install colormin --save | ||
MIT © Ben Briggs | ||
MIT © [Ben Briggs](http://beneb.info) | ||
@@ -35,0 +37,0 @@ [ci]: https://travis-ci.org/ben-eb/colormin |
Sorry, the diff of this file is not supported yet
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the 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
38
5622
1
+ Addedcolor@0.9.0(transitive)
- Removedcolor@0.8.0(transitive)
Updatedcolor@^0.9.0