All Projects → 75lb → typical

75lb / typical

Licence: MIT License
Isomorphic, functional type-checking for Javascript

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to typical

Ansi Escape Sequences
A simple, isomorphic library containing all known terminal ansi escape codes and sequences.
Stars: ✭ 44 (+158.82%)
Mutual labels:  isomorphic, javascript-library
Byte Size
Isomorphic function to convert a bytes value (e.g. 3456) to a human-readable string ('3.5 kB')
Stars: ✭ 33 (+94.12%)
Mutual labels:  isomorphic, javascript-library
ring-election
A node js library with a distributed leader/follower algorithm ready to be used
Stars: ✭ 92 (+441.18%)
Mutual labels:  javascript-library
validate-polish
Utility library for validation of PESEL, NIP, REGON, identity card etc. Aimed mostly at Polish enviroment. [Polish] Walidacja numerów pesel, nip, regon, dowodu osobistego.
Stars: ✭ 31 (+82.35%)
Mutual labels:  javascript-library
isomorphic-relay-boilerplate
No description or website provided.
Stars: ✭ 30 (+76.47%)
Mutual labels:  isomorphic
indexed-string-variation
Experimental JavaScript module to generate all possible variations of strings over an alphabet using an n-ary virtual tree
Stars: ✭ 16 (-5.88%)
Mutual labels:  javascript-library
core
A library for making isomorphic React components with RxJS
Stars: ✭ 12 (-29.41%)
Mutual labels:  isomorphic
infrared
✨🚀 Blazing fast, inferred static type checker for JavaScript.
Stars: ✭ 46 (+170.59%)
Mutual labels:  type-checking
filestorage.js
Filestorage.js is client library for SKALE sidechain decentralized file storage. Used to transfer files between a browser and a SKALE sidechain.
Stars: ✭ 25 (+47.06%)
Mutual labels:  javascript-library
progge.rs
Program analysis playground for a simple, imperative language
Stars: ✭ 29 (+70.59%)
Mutual labels:  type-checking
lexicon-mono-seq
DOM Text Based Multiple Sequence Alignment Library
Stars: ✭ 15 (-11.76%)
Mutual labels:  javascript-library
previewSlider
Responsive fullscreen image slider where the users are able to preview next/previous image when hovering over the navigation arrows.
Stars: ✭ 16 (-5.88%)
Mutual labels:  javascript-library
xss-firewall
xss monitor and intercept
Stars: ✭ 16 (-5.88%)
Mutual labels:  javascript-library
xlib
Your isomorphic toolbox
Stars: ✭ 18 (+5.88%)
Mutual labels:  isomorphic
excel-date-to-js
Convert Excel date in integer format into JS date. Dates are stored as numbers in Excel and count the number of days since January 0, 1900 (1900 standard, for mac it is 1904, which means January 0, 1904 is the start date). Times are handled internally as numbers between 0 and 1.
Stars: ✭ 26 (+52.94%)
Mutual labels:  javascript-library
afinn
Sentiment Analysis in Javascript using the AFINN Lexicon
Stars: ✭ 26 (+52.94%)
Mutual labels:  javascript-library
fetch
Isomorphic Wordpress API client and React hooks - super tiny, super fast.
Stars: ✭ 47 (+176.47%)
Mutual labels:  isomorphic
Contemplate
Contemplate: Fast, extendable object-oriented and light-weight Template Engine for PHP, Python, Node.js, Browser and XPCOM/SDK JavaScript
Stars: ✭ 15 (-11.76%)
Mutual labels:  isomorphic
ng2-rest
Isomorphic, simple, robust REST API library for Browser and NodeJS, ( ts / js ) apps
Stars: ✭ 26 (+52.94%)
Mutual labels:  isomorphic
movies
Real world isomorphic application for movies search, based on Webpack 5 / Express / React 17 + Redux-Saga / Bootstrap 4.6 + CSS Modules / i18next / SSR
Stars: ✭ 20 (+17.65%)
Mutual labels:  isomorphic

head

view on npm npm module downloads Gihub repo dependents Gihub package dependents Node.js CI Coverage Status

js-standard-style

typical

Isomorphic, functional type-checking for Javascript.

Example

import * as t from 'typical'
const allDefined = array.every(t.isDefined)

t.isNumber(n) ⇒ boolean

Returns true if input is a number (including infinity). It is a more reasonable alternative to typeof n which returns number for NaN.

Kind: static method of typical
Returns: boolean - true if input is a number

Param Type Description
n * The input to test

Example

> t.isNumber(0)
true
> t.isNumber(1)
true
> t.isNumber(1.1)
true
> t.isNumber(0xff)
true
> t.isNumber(0644)
true
> t.isNumber(6.2e5)
true
> t.isNumber(NaN)
false
> t.isNumber(Infinity)
true

t.isFiniteNumber(n) ⇒ boolean

Returns true if input is a finite number. Identical to isNumber beside excluding infinity.

Kind: static method of typical

Param Type Description
n * The input to test

Example

> t.isFiniteNumber(0)
true
> t.isFiniteNumber(1)
true
> t.isFiniteNumber(1.1)
true
> t.isFiniteNumber(0xff)
true
> t.isFiniteNumber(0644)
true
> t.isFiniteNumber(6.2e5)
true
> t.isFiniteNumber(NaN)
false
> t.isFiniteNumber(Infinity)
false

t.isPlainObject(input) ⇒ boolean

A plain object is a simple object literal, it is not an instance of a class. Returns true if the input typeof is object and directly decends from Object.

Kind: static method of typical

Param Type Description
input * The input to test

Example

> t.isPlainObject({ something: 'one' })
true
> t.isPlainObject(new Date())
false
> t.isPlainObject([ 0, 1 ])
false
> t.isPlainObject(/test/)
false
> t.isPlainObject(1)
false
> t.isPlainObject('one')
false
> t.isPlainObject(null)
false
> t.isPlainObject((function * () {})())
false
> t.isPlainObject(function * () {})
false

t.isArrayLike(input) ⇒ boolean

An array-like value has all the properties of an array yet is not an array instance. An example is the arguments object. Returns true`` if the input value is an object, not null`` and has a length property set with a numeric value.

Kind: static method of typical

Param Type Description
input * The input to test

Example

function sum(x, y){
  console.log(t.isArrayLike(arguments))
  // prints `true`
}

t.isObject(input) ⇒ boolean

Returns true if the typeof input is 'object' but not null.

Kind: static method of typical

Param Type Description
input * The input to test

t.isDefined(input) ⇒ boolean

Returns true if the input value is defined.

Kind: static method of typical

Param Type Description
input * The input to test

t.isUndefined(input) ⇒ boolean

Returns true if the input value is undefined.

Kind: static method of typical

Param Type Description
input * The input to test

t.isNull(input) ⇒ boolean

Returns true if the input value is null.

Kind: static method of typical

Param Type Description
input * The input to test

t.isDefinedValue(input) ⇒ boolean

Returns true if the input value is not one of undefined, null, or NaN.

Kind: static method of typical

Param Type Description
input * The input to test

t.isClass(input) ⇒ boolean

Returns true if the input value is an ES2015 class.

Kind: static method of typical

Param Type Description
input * The input to test

t.isPrimitive(input) ⇒ boolean

Returns true if the input is a string, number, symbol, boolean, null or undefined value.

Kind: static method of typical

Param Type Description
input * The input to test

t.isPromise(input) ⇒ boolean

Returns true if the input is a Promise.

Kind: static method of typical

Param Type Description
input * The input to test

t.isIterable(input) ⇒ boolean

Returns true if the input is an iterable (Map, Set, Array, Generator etc.).

Kind: static method of typical

Param Type Description
input * The input to test

Example

> t.isIterable('string')
true
> t.isIterable(new Map())
true
> t.isIterable([])
true
> t.isIterable((function * () {})())
true
> t.isIterable(Promise.resolve())
false
> t.isIterable(Promise)
false
> t.isIterable(true)
false
> t.isIterable({})
false
> t.isIterable(0)
false
> t.isIterable(1.1)
false
> t.isIterable(NaN)
false
> t.isIterable(Infinity)
false
> t.isIterable(function () {})
false
> t.isIterable(Date)
false
> t.isIterable()
false
> t.isIterable({ then: function () {} })
false

t.isString(input) ⇒ boolean

Returns true if the input value is a string. The equivalent of typeof input === 'string' for use in funcitonal contexts.

Kind: static method of typical

Param Type Description
input * The input to test

t.isFunction(input) ⇒ boolean

Returns true if the input value is a function. The equivalent of typeof input === 'function' for use in funcitonal contexts.

Kind: static method of typical

Param Type Description
input * The input to test

Load anywhere

This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.

Within a Node.js ECMAScript Module:

import * as typical from 'typical'

or

import { isNumber } from 'typical'

Within a modern browser ECMAScript Module:

import typical from './node_modules/typical/index.mjs'

© 2014-21 Lloyd Brookes <[email protected]>.

Isomorphic test suite by test-runner and web-runner. Documented by jsdoc-to-markdown.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].