All files / src/render/dom/value-types find.ts

100% Statements 7/7
100% Branches 0/0
100% Functions 1/1
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 1439x 39x 39x         39x         124x  
import { color, complex } from "style-value-types"
import { dimensionValueTypes } from "./dimensions"
import { testValueType } from "./test"
 
/**
 * A list of all ValueTypes
 */
const valueTypes = [...dimensionValueTypes, color, complex]
 
/**
 * Tests a value against the list of ValueTypes
 */
export const findValueType = (v: any) => valueTypes.find(testValueType(v))