UNPKG

@yamamotok/dataobject

Version:

Decorator based JSON serializer and deserializer.

21 lines (20 loc) 790 B
import { Strategy, Transformed } from '../Strategy'; import { ValueTransformerOptions } from '../ValueTransformerOptions'; /** * Applied in case a primitive type was given through TypeScript type system. * Note: if the value is `undefined`, this always returns `undefined`. * * For example: * [+] property: string; * [+] property?: string; * * Not applied either on these union type ones or array. * [-] property: string | number; * [-] property: string[]; */ export declare class PrimitiveStrategy extends Strategy { protected transform(opts: ValueTransformerOptions): Transformed | undefined; static normalizeNumber(value: unknown): number; static normalizeString(value: unknown): string; static normalizeBoolean(value: unknown): boolean; }