Creates a shape that requires an of the given possible values.
import {unionShape, checkValidShape} from 'object-shape-tester';const myShape = unionShape('', -1);checkValidShape('a', myShape); // `true`checkValidShape(10, myShape); // `true`checkValidShape({}, myShape); // `false` Copy
import {unionShape, checkValidShape} from 'object-shape-tester';const myShape = unionShape('', -1);checkValidShape('a', myShape); // `true`checkValidShape(10, myShape); // `true`checkValidShape({}, myShape); // `false`
Creates a shape that requires an of the given possible values.