colorjs
Advanced tools
Comparing version 0.1.7 to 0.1.8
@@ -5,3 +5,3 @@ require( | ||
bunit: 'lib/bunit', | ||
utils: 'src/utils', | ||
colorutils: 'src/colorutils', | ||
assert: 'lib/assert' | ||
@@ -8,0 +8,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"author": "Juho Vepsalainen <bebraw@gmail.com>", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
@@ -8,0 +8,0 @@ "main": "./lib/color.js", |
@@ -6,11 +6,11 @@ (function(root, factory) { | ||
// like Node. | ||
module.exports = factory(require('./utils')); | ||
module.exports = factory(require('./colorutils')); | ||
} | ||
else if(typeof define === 'function' && define.amd) { | ||
// AMD. Register as an anonymous module. | ||
define(['utils'], factory); | ||
define(['colorutils'], factory); | ||
} | ||
else { | ||
// Browser globals | ||
root.color = factory(root.utils); | ||
root.color = factory(root.colorutils); | ||
} | ||
@@ -367,9 +367,7 @@ }(this, function(utils) { | ||
return function(v) { | ||
if(v) { | ||
channels[name] = utils.clamp(v, 0, 1); | ||
if(!utils.isDefined(v)) return channels[name]; | ||
return methods; | ||
} | ||
channels[name] = utils.clamp(v, 0, 1); | ||
return channels[name]; | ||
return methods; | ||
}; | ||
@@ -376,0 +374,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
define(['bunit', '../src/color', 'utils', 'assert'], | ||
define(['bunit', '../src/color', 'colorutils', 'assert'], | ||
function(bunit, color, utils, assert) { | ||
@@ -105,4 +105,12 @@ var rgba = color.rgba; | ||
c[k](0.5); | ||
assert(c[k]()).equals(0.5); | ||
assert(c[k]()).equals(0.5); | ||
c[k](0); | ||
assert(c[k]()).equals(0); | ||
c[k](-100); | ||
assert(c[k]()).equals(0); | ||
c[k](100); | ||
assert(c[k]()).equals(1); | ||
}; | ||
@@ -109,0 +117,0 @@ }, channels); |
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
126312
2848
1