Creates a shape that requires a string and gives it a specific type. This does not apply any extra type safety beyond string checking.
import {typedString, checkValidShape} from 'object-shape-tester';const myShape = typedString<`${string}-${string}`>();checkValidShape('1-2', myShape); // `true`checkValidShape('1', myShape); // `true`checkValidShape(1, myShape); // `false` Copy
import {typedString, checkValidShape} from 'object-shape-tester';const myShape = typedString<`${string}-${string}`>();checkValidShape('1-2', myShape); // `true`checkValidShape('1', myShape); // `true`checkValidShape(1, myShape); // `false`
Creates a shape that requires a string and gives it a specific type. This does not apply any extra type safety beyond string checking.