UNPKG

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