Comparing version 4.5.1 to 4.5.2
{ | ||
"name": "rttc", | ||
"version": "4.5.1", | ||
"version": "4.5.2", | ||
"description": "Runtime type-checking for JavaScript.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -159,6 +159,22 @@ # rttc | ||
Guesses the type schema from an example value. | ||
Guess the type schema from an example value. | ||
##### .isStrictType(typeSchema, [recursive=false]) | ||
Determine whether the given type schema is "strict" (meaning it is a string, number, boolean, lamda, faceted dictionary, or patterned array). If second argument (`recursive`) is set to `true`, then also recursively check the subkeys of faceted dictionaries and patterns of arrays in the type schema. | ||
| type | is strict? | | ||
|-------------------------|---------------------| | ||
| string | yes _(always)_ | | ||
| number | yes _(always)_ | | ||
| boolean | yes _(always)_ | | ||
| lamda | yes _(always)_ | | ||
| `{}` (generic) | no | | ||
| `[]` (generic) | no | | ||
| `{...}` (faceted) | yes _(maybe recursively)_ | | ||
| `[...]` (patterned) | yes _(maybe recursively)_ | | ||
| json | no | | ||
| ref | no | | ||
### Utilities | ||
@@ -196,21 +212,18 @@ | ||
| actual | `util.inspect()` | `rttc.compile()` | | ||
| ------------------------ | ----------------------------------------- | ------------------------------------ | | ||
| a function | `[Function: foo]` | `'function foo (){}'` | | ||
| a Date | `Tue May 26 2015 20:05:37 GMT-0500 (CDT)` | `'2015-05-27T01:06:37.072Z'` | | ||
| a RegExp | `/foo/gi` | `'/foo/gi/'` | | ||
| an Error | `[Error]` | `'Error\n at repl:1:24\n...'` | | ||
| a deeply nested thing | `{ a: { b: { c: [Object] } } }` | `{ a: { b: { c: { d: {} } } } }` | | ||
| a circular thing | `{ y: { z: [Circular] } }` | `{ y: { z: '[Circular ~]' } }` | | ||
| undefined | `undefined` | `null` | | ||
| Infinity | `Infinity` | `0` | | ||
| -Infinity | `-Infinity` | `0` | | ||
| NaN | `NaN` | `0` | | ||
| Readable (Node stream) | `{ _readableState: { highWaterMar..}}` | `null` | | ||
| Buffer (Node bytestring) | `<Buffer 61 62 63>` | `null` | | ||
| value | util.inspect() | rttc.compile() | | ||
|--------------------------|-------------------------------------------|--------------------------------------| | ||
| a function | `[Function: foo]` | `'function foo (){}'` | | ||
| a Date | `Tue May 26 2015 20:05:37 GMT-0500 (CDT)` | `'2015-05-27T01:06:37.072Z'` | | ||
| a RegExp | `/foo/gi` | `'/foo/gi/'` | | ||
| an Error | `[Error]` | `'Error\n at repl:1:24\n...'` | | ||
| a deeply nested thing | `{ a: { b: { c: [Object] } } }` | `{ a: { b: { c: { d: {} } } } }` | | ||
| a circular thing | `{ y: { z: [Circular] } }` | `{ y: { z: '[Circular ~]' } }` | | ||
| undefined | `undefined` | `null` | | ||
| Infinity | `Infinity` | `0` | | ||
| -Infinity | `-Infinity` | `0` | | ||
| NaN | `NaN` | `0` | | ||
| Readable (Node stream) | `{ _readableState: { highWaterMar..}}` | `null` | | ||
| Buffer (Node bytestring) | `<Buffer 61 62 63>` | `null` | | ||
## Types | ||
@@ -217,0 +230,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
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
160747
584