trim
Trims the specified fields of an item.
import { } from 'feathers-utils/transformers';Example
import { transformData, trim } from 'feathers-utils/transformers'
transformData(item => trim(item, 'password'))Hooks for transformers
| Hook | Description |
|---|---|
transformData | Transforms each item in |
transformQuery | Transforms |
transformResult | Transforms each item in |
Utilities for transformers
| Utility | Description |
|---|---|
mutateData | Applies a transformer function to each item in |
mutateResult | Applies a transformer function to each item in |
Type declaration
Show Type Declarations
/**
* Trims the specified fields of an item.
*
* @example
* ```ts
*
*
* transformData(item => trim(item, 'password'))
* ```
*
* @see https://utils.feathersjs.com/transformers/trim.html
*/
export declare function trim<T extends Record<string, any>>(
item: T,
fieldNames: MaybeArray<StringFieldKey<NoInfer<T>>>,
): void| Argument | Type | Description |
|---|---|---|
| item | T | |
| fieldNames | MaybeArray<StringFieldKey<NoInfer<T>>> |
