object-shape-tester
Version:
Test object properties and value types.
29 lines (28 loc) • 819 B
TypeScript
import { type TUnsafe } from '@sinclair/typebox';
import { type Shape } from '../shape/shape.js';
/**
* Creates a shape that requires matching the exact value give.
*
* @category Shape
* @example
*
* ```ts
* import {exactShape, checkValidShape} from 'object-shape-tester';
*
* const myShape = exactShape('a');
*
* checkValidShape('a', myShape); // `true`
* checkValidShape('c', myShape); // `false`
*
* // normally passing a string to a shape will simplify the shape.
* checkValidShape('c', defineShape('a')); // `true`
* ```
*/
export declare function exactShape<const T>(value: T): Shape<TUnsafe<T>>;
/**
* Kind for {@link exactShape}'s type registry entry when the value given to {@link exactShape} is a
* symbol.
*
* @category Internal
*/
export declare const exactSymbolKind = "ExactSymbol";