UNPKG

@yookue/ts-lang-utils

Version:

Common lang utilities for typescript

4 lines 256 B
import { isEmpty } from "./isEmpty"; export function replaceFirst(text, search, replace) { return isEmpty(text) || !search ? text : text === null || text === void 0 ? void 0 : text.replace(search, replace !== null && replace !== void 0 ? replace : ''); }