New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lutils-typeof

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lutils-typeof - npm Package Compare versions

Comparing version

to
0.2.1

4

CHANGELOG.md

@@ -0,2 +1,6 @@

### `0.2.0` July 1st
- Added lowercase props and added more tests
eg. `typeOf.undefined()`
### `0.1.0`
- Rebuilt

2

package.json
{
"name" : "lutils-typeof",
"description" : "Reliable type checks for javascript primitives",
"version" : "0.2.0",
"version" : "0.2.1",
"author" : { "name": "nfour" },

@@ -6,0 +6,0 @@ "repository" : {

# typeOf `lutils-typeof`
Reliable type checks for javascript primitives
`npm install lutils-typeof`
```js
import typeOf from "lutils-typeof"
// Returns a string
typeOf({}) // "object"
typeOf(5000) // "number"
typeOf(NaN) // "nan"
typeOf(NaN) // "nan"
// Returns a boolean
typeOf.Object({}) // true
typeOf.Object(null) // false
typeOf.object({}) // true
typeOf.string("null") // true
typeOf.Undefined(undefined) // true
typeOf.Boolean(false) // true
typeOf.String("string") // true
typeOf.Function(Function() {}) // true
typeOf.Function(typeOf) // true
typeOf.Array([]) // true
typeOf.Null(null) // true
typeOf.Number(600) // true
typeOf.Number(Infinity) // true
typeOf.Date(new Date()) // true
typeOf.RegExp(/test/i) // true
typeOf.NaN(NaN) // true
typeOf.null(null) // true
typeOf.Null(null) // true
typeOf.undefined(undefined) // true
typeOf.Undefined(undefined) // true
```