Skip to content

Latest commit

 

History

History
95 lines (63 loc) · 1.45 KB

DOCUMENTATION.md

File metadata and controls

95 lines (63 loc) · 1.45 KB

Documentation

Table of contents

Methods

warble.type

warble.type(value);
Param Type Default Description
value Any undefined A value to get the type.

Example

Source
warble.type(['lorem', 'ipsum']);
Output
"array"

warble.is

warble.is(value, type, getDetails);
Param Type Default Description
value Any undefined A value to be tested.
type String, Array undefined The type that the parameter value should be.
getDetails Boolean false Enable a detailed return.

Simple example

Source
var value = 'Lorem ipsum';

warble.is(value, 'number');
Output
false

Multiple tests

Source
var value = '-1';

warble.is(value, ['numeric', 'positive']);
Output
false

Detailed results

Source
var value = '-1';

warble.is(value, ['numeric', 'negative'], true);
Output
{
	"negative": false,
	"numeric": true
}