import {checkValidShape, createCustomShape} from 'object-shape-tester';
import {UtcIsoString, isValidIsoString} from 'date-vir';
const utcIsoStringShape = createCustomShape({
default: new Date().toISOString() as UtcIsoString,
name: 'UtcIsoString',
checkValue(value) {
return isValidIsoString(value);
},
});
const myShape = utcIsoStringShape();
checkValidShape(new Date().toISOString(), myShape); // `true`
checkValidShape('', myShape); // `false`
Easily create a custom shape.