Skip to content

trim

Source Code | Documentation

Trims the specified fields of an item.

ts
  import { 
trim
} from 'feathers-utils/transformers';

Type declaration

ts
/**
 * Trims the specified fields of an item.
 *
 * @example
 * ```ts
 *
 *
 *
 * {
 *   before: {
 *     all: [transformData(trim('password'))],
 *   }
 * }
 * ```
 */
export declare const trim: (fieldNames: MaybeArray<string>) => TransformerFn
ArgumentTypeDescription
fieldNamesMaybeArray<string>

Example

ts
import { transformData, transformResult } from 'feathers-utils/hooks'
import { trim } from 'feathers-utils/transformers'

{
  before: {
    all: [transformData(trim('password'))],
  }
}

Released under the MIT License.