utilizes.prefix

v1.0.2
The utilizes method utilizes.prefix exported as a Node.js module.
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/13/2019

Downloads

Maintainers