2.0.1 • Published 2 years ago

empty-php v2.0.1

Weekly downloads
15
License
MIT
Repository
github
Last release
2 years ago

Empty PHP

Build Status

The purpose of this library is to be a zero dependency and exact replica of the PHP empty function. The library is compatible with evergreen browsers, IE 11 and all Node LTS.

According to the PHP documentation, the following values are considered to be empty:

  • "" (an empty string)
  • 0 (0 as an integer)
  • 0.0 (0 as a float)
  • "0" (0 as a string)
  • NULL
  • FALSE
  • array() (an empty array)

Usage

To use the library:

import empty from "empty-php";

if (empty(myVar)) {
    // It's empty
}

Test

To test:

npm test

Build

To build:

npm run build

Credits

This library was forked from https://github.com/vvmspace/empty-js.

2.0.1

2 years ago

2.0.0

2 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago