1 | import {color} from "d3-color";
|
2 | import rgb from "./rgb";
|
3 | import array from "./array";
|
4 | import number from "./number";
|
5 | import object from "./object";
|
6 | import string from "./string";
|
7 | import constant from "./constant";
|
8 |
|
9 | export default function(a, b) {
|
10 | var t = typeof b, c;
|
11 | return b == null || t === "boolean" ? constant(b)
|
12 | : (t === "number" ? number
|
13 | : t === "string" ? ((c = color(b)) ? (b = c, rgb) : string)
|
14 | : b instanceof color ? rgb
|
15 | : Array.isArray(b) ? array
|
16 | : object)(a, b);
|
17 | }
|