x-is-object

Simple proper object test

Usage no npm install needed!

<script type="module">
  import xIsObject from 'https://cdn.skypack.dev/x-is-object';
</script>

README

x-is-object

Simple proper object test - all objects that inherit Object except null

Example

var isObject = require("x-is-object")

isObject({})
// -> true

isObject([])
// -> true

isObject(/.*/)
// -> true

isObject(new RegExp(".*"))
// -> true

isObject(function () {})
// -> true

isObject(new Date())
// -> true

isObject(new String("hello"))
// -> true

isObject("hello")
// -> false

isObject("")
// -> false

isObject(9)
// -> false

isObject(true)
// -> false

isObject(null)
// -> false

isObject(undefined)
// -> false

Installation

npm install x-is-object

Contributors

  • Matt-Esch

MIT Licenced