UNPKG

@yookue/ts-lang-utils

Version:

Common lang utilities for typescript

4 lines 171 B
import { startsWith } from "./startsWith"; export function prependIfMissing(text, prefix) { return !text || !prefix || startsWith(text, prefix) ? text : prefix + text; }