Comparing version 6.6.0 to 6.7.0
import { Runtype, RuntypeBase, Static } from '../runtype'; | ||
export declare const RuntypeName: unique symbol; | ||
export interface RuntypeBrand<B extends string> { | ||
[RuntypeName]: B; | ||
[RuntypeName]: { | ||
[k in B]: B; | ||
}; | ||
} | ||
@@ -6,0 +8,0 @@ export interface Brand<B extends string, A extends RuntypeBase> extends Runtype<Static<A> & RuntypeBrand<B>> { |
{ | ||
"name": "runtypes", | ||
"version": "6.6.0", | ||
"version": "6.7.0", | ||
"description": "Runtime validation for static types", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -356,2 +356,12 @@ # Runtypes [![Build Status](https://travis-ci.org/pelotom/runtypes.svg?branch=master)](https://travis-ci.org/pelotom/runtypes) [![Coverage Status](https://coveralls.io/repos/github/pelotom/runtypes/badge.svg?branch=master)](https://coveralls.io/github/pelotom/runtypes?branch=master) | ||
## `instanceof` wrapper | ||
If you have access to the class that you want to test values with the `instanceof` operator, then the `InstanceOf` runtype is exactly what you're looking for. Usage is straightforward: | ||
```ts | ||
class ObjectId { ... }; | ||
const ObjectIdChecker = InstanceOf(ObjectId); | ||
ObjectIdChecker.check(value); | ||
``` | ||
## Function contracts | ||
@@ -547,3 +557,3 @@ | ||
- [generate-runtypes](https://github.com/cobraz/generate-runtypes#readme) Generates runtypes from structured data. Useful for code generators | ||
- [generate-runtypes](https://github.com/simenandre/generate-runtypes#readme) Generates runtypes from structured data. Useful for code generators | ||
- [json-to-runtypes](https://github.com/runeh/json-to-runtypes#readme) Generates runtypes by parsing example JSON data | ||
@@ -550,0 +560,0 @@ - [rest.ts](https://github.com/hmil/rest.ts) Allows building type safe and runtime-checked APIs |
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
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
124289
2531
562