Socket
Socket
Sign inDemoInstall

typedescriptor

Package Overview
Dependencies
Maintainers
6
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typedescriptor - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

build/lib/TypeDescriptor.d.ts

9

package.json
{
"name": "typedescriptor",
"version": "1.1.0",
"version": "1.2.0",
"description": "typedescriptor identifies and describes types.",

@@ -15,7 +15,8 @@ "contributors": [

],
"main": "lib/TypeDescriptor.js",
"main": "build/lib/TypeDescriptor.js",
"types": "build/lib/TypeDescriptor.d.ts",
"dependencies": {},
"devDependencies": {
"assertthat": "3.2.0",
"roboter": "6.1.0"
"assertthat": "3.3.0",
"roboter": "7.0.0"
},

@@ -22,0 +23,0 @@ "repository": {

@@ -66,2 +66,20 @@ # typedescriptor

### TypeScript Type Guards
Since using the descriptors above doesn't tell TypeScript anything, there are type guards for every type check:
```typescript
import Type from 'typedescriptor';
const someValue = getSomeValue() as any;
if (Type.isArray(someValue)) {
// TypeScript now realizes that `someValue` is of type []
}
if (Type.isValueType(someValue)) {
// TypeScript now realizes that `someValue` is of type string | number | boolean | null | undefined
}
```
## Running the build

@@ -68,0 +86,0 @@

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