typedescriptor
Advanced tools
Comparing version 1.1.0 to 1.2.0
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
12408
8
219
91
1