Comparing version 4.4.1 to 4.4.2
@@ -13,3 +13,3 @@ module.exports = { | ||
dehydrate: require('./lib/dehydrate'), | ||
compile: require('./lib/inspect'), | ||
compile: require('./lib/compile'), | ||
sample: require('./lib/sample'), | ||
@@ -16,0 +16,0 @@ getDisplayType: require('./lib/get-display-type'), |
{ | ||
"name": "rttc", | ||
"version": "4.4.1", | ||
"version": "4.4.2", | ||
"description": "Runtime type-checking for JavaScript.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -176,7 +176,7 @@ # rttc | ||
##### .inspect(value) | ||
##### .compile(value) | ||
Given a value, return a human-readable string which represents it. This string is equivalent to a JavaScript code snippet which would accurately represent the value in code. | ||
This is a lot like `util.inspect(val, false, null)`, but it also has special handling for Errors, Dates, RegExps, and Functions (using `dehydrate()` with `allowNull` enabled.) The biggest difference is that everything you get from `rttc.inspect()` is ready for use as values in `*`, `{}`, or `[]` type machines, Treeline, Angular's rendering engine, and JavaScript code in general (i.e. if you were to append it on the right-hand side of `var x = `, or if you ran `eval()` on it) | ||
This is a lot like `util.inspect(val, false, null)`, but it also has special handling for Errors, Dates, RegExps, and Functions (using `dehydrate()` with `allowNull` enabled.) The biggest difference is that everything you get from `rttc.compile()` is ready for use as values in `*`, `{}`, or `[]` type machines, Treeline, Angular's rendering engine, and JavaScript code in general (i.e. if you were to append it on the right-hand side of `var x = `, or if you ran `eval()` on it) | ||
@@ -193,6 +193,6 @@ Note that undefined values in arrays and undefined values of keys in dictionaries will be stripped out, and circular references will be handled as they are in `util.inspect(val, false, null)` | ||
Here's a table listing notable differences between `util.inspect()` and `rttc.inspect()` for reference: | ||
Here's a table listing notable differences between `util.inspect()` and `rttc.compile()` for reference: | ||
| actual | `util.inspect()` | `rttc.inspect()` | | ||
| actual | `util.inspect()` | `rttc.compile()` | | ||
| ------------------------ | ----------------------------------------- | ------------------------------------ | | ||
@@ -199,0 +199,0 @@ | a function | `[Function: foo]` | `'function foo (){}'` | |
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