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

typa

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typa - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

2

package.json
{
"name": "typa",
"version": "0.1.7",
"version": "0.1.8",
"description": "JavaScript type checker utility",

@@ -5,0 +5,0 @@ "main": "dist/typa.min.js",

@@ -22,2 +22,23 @@ Typa

Available Types
---------------
+ <a href="#array">*arr*</a>: Array
+ <a href="#bad">*bad*</a>: Null, undefined, empty, or an error
+ <a href="#boolean">*bool*</a>: Boolean
+ <a href="#date">*date*</a>: Date
+ <a href="#empty">*empty*</a>: Empty string, array, or object
+ <a href="#error">*err*</a>: Error
+ <a href="#function">*fn*</a>: Function
+ <a href="#integer">*int*</a>: Integer
+ <a href="#json">*json*</a>: Serialized JSON object
+ <a href="#null">*nll*</a>: Null
+ <a href="#noru">*noru*</a>: Null or undefined
+ <a href="#number">*num*</a>: Number
+ <a href="#object">*obj*</a>: Object
+ <a href="#promise">*prom*</a>: Promise
+ <a href="#regex">*regex*</a>: Regular expression
+ <a href="#string">*str*</a>: String
+ <a href="#symbol">*sym*</a>: Symbol
+ <a href="#undefined">*undef*</a>: Undefined
Typa Function

@@ -28,22 +49,2 @@ -------------

### Available Types
+ *arr*: Array
+ *bad*: Null, undefined, empty, or an error
+ *bool*: Boolean
+ *date*: Date
+ *empty*: Empty string, array, or object
+ *err*: Error
+ *fn*: Function
+ *int*: Integer
+ *json*: Serialized JSON object
+ *nll*: Null
+ *noru*: Null or undefined
+ *num*: Number
+ *obj*: Object
+ *prom*: Promise
+ *regex*: Regular expression
+ *str*: String
+ *sym*: Symbol
+ *undef*: Undefined
Method:

@@ -72,3 +73,3 @@ ```

**Array**
<a name="array"></a>**Array**
Method:

@@ -84,5 +85,25 @@ ```

**Boolean**
<a name="bad"></a>**Bad**
Method:
```
is.bad($value)
```
Example:
```
let isBad = is.bad(null)
// => true
isBad = is.bad(undefined)
// => true
isBad = is.bad({})
// => true
isBad = is.bad(new Error('This is an error'))
// => true
```
<a name="boolean"></a>**Boolean**
Method:
```
is.bool($value)

@@ -99,3 +120,3 @@ ```

**Date**
<a name="date"></a>**Date**
Method:

@@ -111,3 +132,3 @@ ```

**Empty**
<a name="empty"></a>**Empty**
Method:

@@ -129,3 +150,3 @@ ```

**Error**
<a name="error"></a>**Error**
Method:

@@ -141,3 +162,3 @@ ```

**Function**
<a name="function"></a>**Function**
Method:

@@ -153,3 +174,3 @@ ```

**Integer**
<a name="integer"></a>**Integer**
Method:

@@ -165,3 +186,3 @@ ```

**JSON**
<a name="json"></a>**JSON**
Method:

@@ -177,3 +198,3 @@ ```

**Null**
<a name="null"></a>**Null**
Method:

@@ -189,3 +210,3 @@ ```

**Null or Undefined**
<a name="noru"></a>**Null or Undefined**
Method:

@@ -204,3 +225,3 @@ ```

**Number**
<a name="number"></a>**Number**
Method:

@@ -216,3 +237,3 @@ ```

**Object**
<a name="object"></a>**Object**
Method:

@@ -228,2 +249,3 @@ ```

<a name="promise"></a>
**Promise**

@@ -236,16 +258,16 @@ Method:

```
const isProm = is.prom(
new Promise((resolve, reject) => {
try {
console.log('I make a promise to you')
resolve()
} catch(err) {
reject(err)
}
})
)
// => true
const myPromise = new Promise((resolve, reject) => {
try {
console.log('I make a promise to you')
resolve()
} catch(err) {
reject(err)
}
})
const isProm = is.prom(myPromise)
// => true
```
<a name="regex"></a>
**Regex**

@@ -262,2 +284,3 @@ Method:

<a name="string"></a>
**String**

@@ -274,2 +297,3 @@ Method:

<a name="symbol"></a>
**Symbol**

@@ -286,2 +310,3 @@ Method:

<a name="undefined"></a>
**Undefined**

@@ -288,0 +313,0 @@ Method:

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc