1.1.0 • Published 1 year ago

gokit v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

gokit

Handy functions

Import

CJS

// Default import
const gokit = require('gokit');

// Named import
const {cap} = require('gokit');

ESM

// Default import
import gokit from 'gokit';

// Named import
import {cap} from 'gokit';

Functions

  • cap(str:string)

    Converts first letter to uppercase

    const str = 'some string';
    console.log(cap(str)); // Some string
  • fcap(str: string)

    Converts first letter of each string to uppercase

    const str = 'some string';
    console.log(fcap(str)); // Some String
  • ftrim(str: string)

    Removes all extra spaces

    const str = '  some     string   ';
    console.log(ftrim(str)); // some string
  • fname(str: string)

    Breaks fullname into 3 parts (firstname, middlename, lastname). Returns an object with keys (first, middle, last). Removes all extra spaces and converts all letters to lowercase.

    const fullname = ' Mike  John  Doe   Ali  ';
    console.log(fname(fullname)) 
    // output ⬇️
    {
        first: 'mike',
        middle: 'john doe',
        last: 'ali'
    }
1.1.0

1 year ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago