@migudevelop/project-helpers
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Project-helpers

A collection of utilities to assist in projects

Installation

  # NPM
  pnpm install @migudevelop/project-helpers

  # NPM
  npm install @migudevelop/project-helpers

  # YARN
  yarn add @migudevelop/project-helpers

Usage

Using CommonJS

// CommonJS
const utils = require('@migudevelop/project-helpers')

console.log(utils.isString('Programming'))

Using ES6 Modules or TypeScript:

// ES6 Modules or TypeScript
import { isEmptyString } from '@migudevelop/project-helpers'

console.log(isEmptyString('Programming'))

Utitlies

String

  • isEmptyString - Determines whether a value is an empty string

Array

  • isEmptyArray - Determines whether a value is an empty string
  • createArrayByLength - Create an array of numbers with the given length

Styles

  • generateClassNames - Creates a string with the values provided, it is fine to provide a conditional classes.

    This method eliminates undefined values, you can pass conditionals to provide a class or not, for example:

    const classes = generateClassNames(
      'btn',
      variant && `btn-${variant}`,
      disabled && 'btn-disabled',
    )

Types

  • isString() - Determines whether a value is a string

  • isNumber() - Determines whether a value is a number

  • isBoolean() - Determines whether a value is a boolean

  • isNull() - Determines whether a value is null

  • isArray() - Determines whether a value an array

  • isFunction() - Determines whether a value is a function

  • isUndefined() - Determines whether a value is undefined

  • isNullish() - Determines whether a value is undefined or null

License

MIT License

Copyright (c) 2024 Migudevelop

Package Sidebar

Install

npm i @migudevelop/project-helpers

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

15.3 kB

Total Files

24

Last publish

Collaborators

  • migudevelop