Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@craftworks/craftworks-library-js

craftworksgmbh239MITdeprecated1.1.3TypeScript support: included

This package has been renamed to @craftworks/js-utils. Install @craftworks/js-utils instead. See https://www.npmjs.com/package/@craftworks/js-utils

A JavaScript library used at craftworks

craftworks, library, js

readme

@craftworks/craftworks-library-js

NPM version Downloads

A JavaScript library used at craftworks

Installation

npm install --save @craftworks/craftworks-library-js

API

/**
* Checks if a value is defined
*
* A value is not defined if
*   value === undefined || value === null
*/
function isDefined<Type>(value: Type | undefined | null): value is Type;

/**
 * Checks if a value is a number
 *
 * According to the JavaScript definition, NaN and Infinity are considered valid numbers
 */
function isNumber(value: unkown): value is number;

/**
 * Checks if a value is a string
 */
function isString(value: unkown): value is string;