@craftworks/js-utils
TypeScript icon, indicating that this package has built-in type declarations

1.2.6 • Public • Published

@craftworks/js-utils

NPM version Downloads

A JavaScript library that provides useful general-purpose functionalities.

Installation

npm install --save @craftworks/js-utils

API

/**
 * Checks if the given value is defined (not undefined or null).
 *
 * @template Type
 * @param {Type | undefined | null} value - The value to be checked.
 * @returns {boolean} Returns true if the value is defined, otherwise false.
 */
function isDefined<Type>(value: Type | undefined | null): value is Type;

/**
 * Checks if the given value is a number.
 * @param value - The value to be checked.
 * @returns Returns true if the value is a number, otherwise false.
 */
function isNumber(value: unkown): value is number;

/**
 * Checks if a value is a string
 * @param value - The value to be checked.
 * @returns Returns true if the value is a string, otherwise false.
 */
function isString(value: unkown): value is string;

Change Log

See CHANGELOG.md

License

MIT

Package Sidebar

Install

npm i @craftworks/js-utils

Weekly Downloads

191

Version

1.2.6

License

MIT

Unpacked Size

8.44 kB

Total Files

19

Last publish

Collaborators

  • zualexander
  • phi_spindler