1.2.0 • Published 5 months ago

@sineverba/concatenate v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Concatenate

CI / CDStatus
NPMnpm version
Semaphore CIBuild Status
Circle CICircleCI
CoverallCoverage Status
SonarCloudQuality 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

1.2.0

5 months ago

1.1.0

10 months ago

1.0.0

1 year ago