object-shape-tester
Version:
Test object properties and value types.
20 lines (19 loc) • 567 B
TypeScript
import { type TUnsafe } from '@sinclair/typebox';
import { type Shape } from '../shape/shape.js';
/**
* Creates a shape that allows any value. This should be used sparingly.
*
* @category Shape
* @example
*
* ```ts
* import {unknownShape, checkValidShape} from 'object-shape-tester';
*
* const myShape = unknownShape();
*
* checkValidShape('a', myShape); // `true`
* checkValidShape(10, myShape); // `true`
* checkValidShape({}, myShape); // `true`
* ```
*/
export declare function unknownShape<T = unknown>(defaultValue?: unknown): Shape<TUnsafe<T>>;