added unit testing, and started implementing unit tests...phew

This commit is contained in:
Josh Burman
2019-03-12 22:28:02 -04:00
parent 74aad4a957
commit e8c2539f1b
3489 changed files with 464813 additions and 88 deletions

79
node_modules/colornames/index.js generated vendored Normal file
View File

@ -0,0 +1,79 @@
/**
* Module dependencies
*/
var colors = require('./colors')
var cssColors = colors.filter(function(color){
return !! color.css
})
var vgaColors = colors.filter(function(color){
return !! color.vga
})
/**
* Get color value for a certain name.
* @param name {String}
* @return {String} Hex color value
* @api public
*/
module.exports = function(name) {
var color = module.exports.get(name)
return color && color.value
}
/**
* Get color object.
*
* @param name {String}
* @return {Object} Color object
* @api public
*/
module.exports.get = function(name) {
name = name || ''
name = name.trim().toLowerCase()
return colors.filter(function(color){
return color.name.toLowerCase() === name
}).pop()
}
/**
* Get all color object.
*
* @return {Array}
* @api public
*/
module.exports.all = module.exports.get.all = function() {
return colors
}
/**
* Get color object compatible with CSS.
*
* @return {Array}
* @api public
*/
module.exports.get.css = function(name) {
if (!name) return cssColors
name = name || ''
name = name.trim().toLowerCase()
return cssColors.filter(function(color){
return color.name.toLowerCase() === name
}).pop()
}
module.exports.get.vga = function(name) {
if (!name) return vgaColors
name = name || ''
name = name.trim().toLowerCase()
return vgaColors.filter(function(color){
return color.name.toLowerCase() === name
}).pop()
}