UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

12 lines (9 loc) 249 B
import { trimEnd } from './trimEnd.mjs'; import { trimStart } from './trimStart.mjs'; function trim(str, chars) { if (chars === undefined) { return str.trim(); } return trimStart(trimEnd(str, chars), chars); } export { trim };