Skip to content

trim

Source Code | Documentation

Trims the specified fields of an item.

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

Type declaration

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

Example

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

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

Released under the MIT License.