be

be

beJS has the following interfaces:

  • all, all checks must be satisfied
  • any, also just one check can be satisfied
  • not, return "logical not" of called method

all, any can accept array or arguments

You can access the methods directly from "be.boolean" or from the class eg "be.Types.boolean". Also the classes supports all, any, not

Source:

Example

// call a method
be.boolean(true);

// call interface "not"
be.not.boolean(1);

// call interface "all" and passing arguments
be.all.boolean(true, false, true);

// call interface "all" and passing array
be.all.boolean([true, false, true]);

// call interface "any" and passing arguments
be.any.boolean(true, false, 1);

Methods

getVersion() → {string}

Get version of framework

Source:
Returns:
Type:
string

setAssert(name, func)

Set new/overwrite method

Since:
  • 1.4.1
Source:
Parameters:
Name Type Description
name string

assertion name

func function

function

Example
be.setAssert('myAssert', (a, b) => {
     return a === b;
});
be.myAssert(true, true) // true