Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A collection of JS helper functions to be used in conditional logic within projects.

NotificationsYou must be signed in to change notification settings

garydavisonos/conditional-helpers

Repository files navigation

A collection of JavaScript helper functions to be used in conditional logic within projects.

Code QualityPublish to npmVersionESLintTypeScript

Table of Contents

Installation

To install theconditional-helpers package, run the following command in your terminal:

npm install conditional-helpers

Usage

Import the conditional-helpers package in your JavaScript file and use the helper functions as needed. For example:

import{isString,isNumber,isArray}from"conditional-helpers";console.log(isString("hello"));// trueconsole.log(isNumber(42));// trueconsole.log(isArray([1,2,3]));// true

Functions

The following helper functions are available in the conditional-helpers package:

  • isArray: Checks if a value is an array.
  • isBoolean: Checks if a value is a boolean.
  • isBooleanFalsey: Checks if a boolean value is falsey.
  • isBooleanTruthy: Checks if a boolean value is truthy.
  • isDate: Checks if a value is a date.
  • isFunction: Checks if a value is a function.
  • isHTML: Checks if a value is an HTML string.
  • isNumber: Checks if a value is a number.
  • isObject: Checks if a value is an object.
  • isObjectEmpty: Checks if an object is empty.
  • isObjectHasProps: Checks if an object has properties.
  • isString: Checks if a value is a string.
  • isStringEmpty: Checks if a string is empty.
  • isStringHasLength: Checks if a string has length.
  • isArrayEmpty: Checks if an array is empty.
  • isArrayHasLength: Checks if an array has length.
  • hasLength: Checks if a value has length.

License

The conditional-helpers package is licensed under the ISC license.

About

A collection of JS helper functions to be used in conditional logic within projects.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp