@modular-forms/react
Version:
The modular and type-safe form library for React
13 lines (12 loc) • 374 B
JavaScript
import { toCustom } from './toCustom';
/**
* Creates a transformation functions that removes the leading and trailing
* white space and line terminator characters from a string.
*
* @param options The transform options.
*
* @returns A transformation functions.
*/
export function toTrimmed(options) {
return toCustom((value) => value && value.trim(), options);
}