@thinice/safe-trim
v0.1.4
Published
Trims only if input is a string, otherwise returns input
Readme
@thinice/safe-trim
Trims only if input is a string, otherwise returns input.
Installation
npm install @thinice/safe-trimUsage
import { safeTrim } from "@thinice/safe-trim";
safeTrim(" hello "); // "hello"
safeTrim(42); // 42
safeTrim(null); // nullSource
https://github.com/thinicejs/utils/tree/main/packages/safe-trim
