Every pipe must implement the PipeTransform interface, which requires a single transform(value, metadata) method. The value argument is the raw incoming argument before transformation. The metadata object contains type (where the value came from), metatype (the TypeScript class), and data (the decorator key like 'id' from @Param('id')).
value — the raw incoming argument before any transformation or validation.
metadata.type — 'body', 'query', 'param', or 'custom' depending on the decorator used.
metadata.metatype — the TypeScript class associated with the parameter; used by ValidationPipe to instantiate the DTO.
metadata.data — the string key passed to the decorator, e.g. @Param('id') gives data = 'id'.
Both value and metadata are available to every pipe — use metadata to make pipes behave differently per source.