utilizes.suffix

Adding fix to the end of a string only if the string is present.

Usage no npm install needed!

<script type="module">
  import utilizesSuffix from 'https://cdn.skypack.dev/utilizes.suffix';
</script>

README

suffix

Adding fix to the end of a string only if the string is present.

Usage: suffix(value: string, fix: string): string

import { suffix } from 'utilizes.suffix'

suffix('Mr ', 'john')
// Output: 'Mr john'
suffix('Mr ', null)
// Output: 'Mr '
suffix(null, 'john')
// Output: ''

This module exported from utilizes project.