utilizes.prefix

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

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.

Metadata

  • MIT
  • Whatever
  • Natan Farkash
  • released 1/15/2019

Downloads

Maintainers