@vladbasin/strong-api-mapping
Version:
Strongly typed API models. Mapping & validation
12 lines (10 loc) • 348 B
text/typescript
import { defineDecorator, ParserType } from '../../src';
export const context = (options: { key?: string; parser?: ParserType }): PropertyDecorator =>
defineDecorator({
source: 'context',
useKey: true,
isKeyCaseSensitive: false,
key: options.key,
parser: options.parser,
isCustom: true,
});