@monstermann/fn
Version:
A utility library for TypeScript.
22 lines (20 loc) • 376 B
JavaScript
import { dfdlT } from "@monstermann/dfdl";
//#region src/string/trim.ts
/**
* `trim(target)`
*
* Removes whitespace from both ends of `target` string.
*
* ```ts
* trim(" hello world "); // "hello world"
* ```
*
* ```ts
* pipe(" hello world ", trim()); // "hello world"
* ```
*/
const trim = dfdlT((target) => {
return target.trim();
}, 1);
//#endregion
export { trim };