Skip to content

Commit dab54c4

Browse files
committed
Use NullObject convention
1 parent 6359cb1 commit dab54c4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = function rgba (color, normalize) {
1111

1212
var parsed = parse(color);
1313

14-
if (!parsed.space) return null;
14+
if (!parsed.space) return [];
1515

1616
if (Array.isArray(color)) return color;
1717

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ assert.deepEqual(rgba('rgb(300,300,300)'), [1,1,1,1])
1111
assert.deepEqual(rgba('rgba(-300,-300,-300,-1)'), [0,0,0,0])
1212
assert.deepEqual(rgba([0,0,0,0]), [0,0,0,0])
1313

14-
assert.equal(rgba('xyz'), null)
14+
assert.deepEqual(rgba('xyz'), [])
1515
// console.log(rgba('hsla(170, 50%, 45%, 1)'))

0 commit comments

Comments
 (0)