@sineverba/concatenate
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

Concatenate

CI / CD Status
NPM npm version
Semaphore CI Build Status
Circle CI CircleCI
Coverall Coverage Status
SonarCloud Quality Gate Status

concatenate returns a single string starting from two strings. If first (or second) string are empty, it returns the other one.

Why is it useful?

I use it in a name + surname concatenation, if one of them can be empty. E.g. "Alex" + "" doesn't return "Alex " (note the space!) but "Alex".

Installation

npm install @sineverba/concatenate

Usage

import { concatenate } from "@sineverba/concatenate";

const name = " ";
const surname = "Foo";

const result = concatenate(name, surname);
console.log(result); // prints Foo

Tests

npm run test for simple test

npm run cover for coverage

Package Sidebar

Install

npm i @sineverba/concatenate

Weekly Downloads

3

Version

1.2.0

License

MIT

Unpacked Size

4.71 kB

Total Files

5

Last publish

Collaborators

  • sineverba