Mixed

Various checks.

Methods

(inner) base64(value) → {boolean}

Check if is base64 encoded string

Interfaces: all, any, not, err

Source:
Parameters:
Name Type Description
value string

base64 string

Returns:
Type:
boolean
Example
be.base64('aGVsbG8=') // true

(inner) compareVersion(a, operator, b, major) → {boolean}

Compare two version number

Interfaces: not, err

Since:
  • 1.6.0
Source:
Parameters:
Name Type Description
a string

version a

operator string

operator "==", "<", "<=", ">", ">="

b string

version b

major boolean

consider major only

Returns:
Type:
boolean
Example
be.compareVersion('1.0.2', '==', '1.0.3') // false
//Consider major only
be.compareVersion('1.0.2', '==', '1.0.3', true) // true

(inner) email(value) → {boolean}

Check if is valid email https://emailregex.com/ Interfaces: all, any, not, err

Source:
Parameters:
Name Type Description
value string

email

Returns:
Type:
boolean
Example
be.email('fabio@rica.li') // true
be.not.email('fabiorica.li') // true

(inner) equal(value, other) → {boolean}

Checks if equal

Interfaces: not, err

Source:
Parameters:
Name Type Description
value Number | String | Boolean | RegExp | Array | Object

first

other Number | String | Boolean | RegExp | Array | Object

second

Returns:
Type:
boolean
Example
be.equal('hello', 'hello') // true
be.equal('hello', 'hellow') // false
be.equal(true, 'true') // false
be.equal([1,2,3], [1,1,1]) // false
be.equal({a:1}, {a:1}) // true

(inner) fiscalCodeIT(value) → {boolean}

Check if is an IT fiscal code

Interfaces: all, any, not, err

Source:
Parameters:
Name Type Description
value string

code string

Returns:
Type:
boolean
Example
be.fiscalCodeIT('OLEFBA97C64F158X') // true

(inner) hex(value) → {boolean}

Check if is a hexadecimal

Interfaces: all, any, not, err

Source:
Parameters:
Name Type Description
value string

hex string

Returns:
Type:
boolean
Example
be.hex('fff') // true

(inner) hexColor(value) → {boolean}

Check if is a hexadecimal color

Interfaces: all, any, not, err

Source:
Parameters:
Name Type Description
value string

hex color string

Returns:
Type:
boolean
Example
be.hexColor('#ff0000') // true

(inner) ip(value) → {boolean}

Check if is a valid ip string

Interfaces: all, any, not, err

Source:
Parameters:
Name Type Description
value string

ip string

Returns:
Type:
boolean
Example
be.ip('127.0.0.1') // true

(inner) ipv4(value) → {boolean}

Check if is a valid IPv4

Interfaces: all, any, not, err

Source:
Parameters:
Name Type Description
value string

ip string

Returns:
Type:
boolean
Example
be.ipv4('127.0.0.1') // true

(inner) ipv6(value) → {boolean}

Check if is a valid IPv6

Interfaces: all, any, not, err

Source:
Parameters:
Name Type Description
value string

ip string

Returns:
Type:
boolean
Example
be.ipv6('FF01:0:0:0:0:0:0:1') // true

(inner) isrc(value) → {boolean}

Check if is ISRC Interfaces: all, any, not, err

Since:
  • 1.7.0
Source:
Parameters:
Name Type Description
value string

ISRC code

Returns:
Type:
boolean
Example
be.isrc('JMK401400212') // true

(inner) iswc(value) → {boolean}

Check if is ISWC Interfaces: all, any, not, err

Since:
  • 1.7.0
Source:
Parameters:
Name Type Description
value string

ISWC code

Returns:
Type:
boolean
Example
be.iswc('T-000000001-0') // true

(inner) macAddress(value) → {boolean}

Check if is a valid MAC address

Interfaces: all, any, not, err

Source:
Parameters:
Name Type Description
value string

MAC string

Returns:
Type:
boolean
Example
be.macAddress('3D:F2:C9:A6:B3:4F') // true

(inner) max(value, num) → {boolean}

Checks if string length or if a number value is greater or equal than a given number

Interfaces: not, err

Since:
  • 1.16.0
Source:
Parameters:
Name Type Description
value string | number

value to check

num number

number target

Returns:
Type:
boolean
Example
be.max(10, 2) // false
be.max('hello', 5) // true

(inner) min(value, num) → {boolean}

Checks if string length or if a number value is lesser or equal than a given number

Interfaces: not, err

Since:
  • 1.16.0
Source:
Parameters:
Name Type Description
value string | number

value to check

num number

number target

Returns:
Type:
boolean
Example
be.min(10, 2) // true
be.min('hello', 3) // true

(inner) semVer(value) → {boolean}

Check if is a valid semver string

Interfaces: all, any, not, err

Source:
Parameters:
Name Type Description
value string

version string

Returns:
Type:
boolean
Example
be.semVer('1.0.0') // true

(inner) uuid(value) → {boolean}

Check if is UUID Interfaces: all, any, not, err

Since:
  • 1.7.0
Source:
Parameters:
Name Type Description
value string

UUID code

Returns:
Type:
boolean
Example
be.uuid('9e3a0460-d72d-11e4-a631-c8e0eb141dab') // true

(inner) uuid1(value) → {boolean}

Check if is UUID ver 1 Interfaces: all, any, not, err

Since:
  • 1.7.0
Source:
Parameters:
Name Type Description
value string

UUID code

Returns:
Type:
boolean
Example
be.uuid1('9e3a0460-d72d-11e4-a631-c8e0eb141dab') // true

(inner) uuid3(value) → {boolean}

Check if is UUID ver 3 Interfaces: all, any, not, err

Since:
  • 1.7.0
Source:
Parameters:
Name Type Description
value string

UUID code

Returns:
Type:
boolean
Example
be.uuid3('2c1d43b8-e6d7-376e-af7f-d4bde997cc3f') // true

(inner) uuid4(value) → {boolean}

Check if is UUID ver 4 Interfaces: all, any, not, err

Since:
  • 1.7.0
Source:
Parameters:
Name Type Description
value string

UUID code

Returns:
Type:
boolean
Example
be.uuid4('366a77ba-d506-4a03-a730-318b8e6be8c5') // true

(inner) uuid5(value) → {boolean}

Check if is UUID ver 5 Interfaces: all, any, not, err

Since:
  • 1.7.0
Source:
Parameters:
Name Type Description
value string

UUID code

Returns:
Type:
boolean
Example
be.uuid5('39888f87-fb62-5988-a425-b2ea63f5b81e') // true