MCPcopy Create free account
hub / github.com/antfu/utils / ensureSuffix

Function ensureSuffix

src/string.ts:28–32  ·  view source on GitHub ↗
(suffix: string, str: string)

Source from the content-addressed store, hash-verified

26 * @category String
27 */
28export function ensureSuffix(suffix: string, str: string) {
29 if (!str.endsWith(suffix))
30 return str + suffix
31 return str
32}
33
34/**
35 * Dead simple template engine, just like Python's `.format()`

Callers 1

string.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected