shaolinmkz-utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Shaolinmkz Utils

CircleCI JavaScript Style Guide NPM Total Download

Util functions for multiple uses.

Installation

npm install shaolinmkz-utils

OR

yarn add shaolinmkz-utils

Usage

import { cleanUpDuplicateAsync } from "shaolinmkz-utils";

const dirtyData = [
  "   Chukwuemeka Obiora Musa    ",
  "Nwabuzor    Obiora     Chukwuemeka",
  "   Chukwuemeka Obiora Nwabuzor    ",
  "   Chukwuemeka Obiora Musa    ",
  "    Nwabuzor Chukwuemeka Obiora     ",
  "Chukwuemeka null Nwabuzor",
  "undefined Chukwuemeka UNDEFINED Nwabuzor",
  "Nwabuzor    Chukwuemeka Obiora",
  "Chukwuemeka undefined Obiora Nwabuzor",
  "   Chukwuemeka James Nwabuzor   ",
];

const result1 = await cleanUpDuplicateAsync(dirtyData);
  console.log(result);
  // [
  //   'Chukwuemeka Obiora Musa',
  //   'Nwabuzor Obiora Chukwuemeka',
  //   'Chukwuemeka James Nwabuzor'
  // ]

try {
  await cleanUpDuplicateAsync([undefined]);
} catch (error) {
  console.log(error);
  //   {
  //     message: "The function argument must be an array of strings"
  //   }
}

Readme

Keywords

Package Sidebar

Install

npm i shaolinmkz-utils

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

3.92 kB

Total Files

4

Last publish

Collaborators

  • shaolinmkz