source: node_modules/d3-interpolate/src/value.js@ e4c61dd

Last change on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago

Prototype 1.1

  • Property mode set to 100644
File size: 806 bytes
Line 
1import {color} from "d3-color";
2import rgb from "./rgb.js";
3import {genericArray} from "./array.js";
4import date from "./date.js";
5import number from "./number.js";
6import object from "./object.js";
7import string from "./string.js";
8import constant from "./constant.js";
9import numberArray, {isNumberArray} from "./numberArray.js";
10
11export default function(a, b) {
12 var t = typeof b, c;
13 return b == null || t === "boolean" ? constant(b)
14 : (t === "number" ? number
15 : t === "string" ? ((c = color(b)) ? (b = c, rgb) : string)
16 : b instanceof color ? rgb
17 : b instanceof Date ? date
18 : isNumberArray(b) ? numberArray
19 : Array.isArray(b) ? genericArray
20 : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
21 : number)(a, b);
22}
Note: See TracBrowser for help on using the repository browser.