utilizes.prefix

Adding fix to beginning of string only if the string is present.

Usage no npm install needed!

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

README

prefix

Adding fix to beginning of string only if the string is present.

Usage: prefix(...args: string[]): string

import { prefix } from 'utilizes.prefix'

prefix('Mr ', 'john')
// Output: 'Mr john'
prefix('Mr ', null)
// Output: ''
prefix(null, 'john')
// Output: 'john'
prefix('Mr ', 'john', ' is', ' rich')
// Output: 'Mr john is rich'
prefix('Mr ', 'john', ' is ', undefined)
// Output: 'Mr john'
prefix('Mr ', 'john', null, ' rich')
// Output: 'Mr john rich'

This module exported from utilizes project.