Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rttc

Package Overview
Dependencies
Maintainers
4
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rttc - npm Package Compare versions

Comparing version 4.4.1 to 4.4.2

lib/compile.js

2

index.js

@@ -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 (){}'` |

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