Transformer
Represents a Transformer having a transform() function and metadata.
template
T,U
Type parameters
▪ T
▪ U
Hierarchy
- Transformer
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
+ new Transformer(transform
: function, meta
: object, config?
: any): Transformer
Sets defaults and instance props
Parameters:
▪ transform: function
▸ (opts?
: any): OperatorFunction‹T, U›
Parameters:
Name | Type |
---|---|
opts? | any |
▪ meta: object
Transformer metdata
Name | Type |
---|---|
alias? | string[] |
defaults? | any |
description? | string |
id | string |
input? | string[] |
output | string |
▪Optional
config: any
Returns: Transformer
Properties
_meta
• _meta: any
_source
• _source: Transformer‹any, any›
_transform
• _transform: function
Type declaration:
▸ (opts?
: any): OperatorFunction‹T, U›
Parameters:
Name | Type |
---|---|
opts? | any |
Static
normalizeFields
▪ normalizeFields: function
Type declaration:
▸ (…args
: any[]): any
Parameters:
Name | Type |
---|---|
...args | any[] |
Accessors
defaults
• get defaults(): any
Returns: any
id
• get id(): any
Returns: any
input
• get input(): any
Returns: any
output
• get output(): any
Returns: any
Methods
canBeginWith
▸ canBeginWith(type
: any): function
Parameters:
Name | Type |
---|---|
type | any |
Returns: function
▸ (target
: T): boolean
Parameters:
Name | Type |
---|---|
target | T |
canEndWith
▸ canEndWith(type
: any): boolean
Parameters:
Name | Type |
---|---|
type | any |
Returns: boolean
canPipeTo
▸ canPipeTo(transformer
: Transformer‹any, any›): function
Returns true
if this Transformer can pipe to another
Parameters:
Name | Type | Description |
---|---|---|
transformer | Transformer‹any, any› | Transformer to compare |
Returns: function
▸ (target
: T): boolean
Parameters:
Name | Type |
---|---|
target | T |
pipe
▸ pipe(transformer
: Transformer‹any, any›): Transformer‹any, any›
Pipe one Transformer to another
Parameters:
Name | Type |
---|---|
transformer | Transformer‹any, any› |
Returns: Transformer‹any, any›
pipeFrom
▸ pipeFrom(transformer
: Transformer‹any, any›): Transformer‹any, any›
Parameters:
Name | Type |
---|---|
transformer | Transformer‹any, any› |
Returns: Transformer‹any, any›
transform
▸ transform(): OperatorFunction‹T, U›
Returns: OperatorFunction‹T, U›