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

typeforce

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typeforce - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

index.js

@@ -12,2 +12,4 @@ function getName (value) {

module.exports = function enforce (type, value) {
var typeName = type
if (typeof type === 'string') {

@@ -95,3 +97,3 @@ if (type[0] === '?') {

throw new TypeError('Expected ' + type + ', got ' + getName(value) + ' ' + value)
throw new TypeError('Expected ' + typeName + ', got ' + getName(value) + ' ' + value)
}
{
"name": "typeforce",
"version": "1.0.0",
"version": "1.0.1",
"description": "Another biased type checking solution for Javascript",

@@ -5,0 +5,0 @@ "main": "./index.js",

@@ -76,2 +76,6 @@ {

"value": [{ "a": 1 }, { "a": null }, {}]
},
{
"type": "?",
"value": null
}

@@ -436,4 +440,14 @@ ],

"value": null
},
{
"exception": "Expected \\?, got Number 1234",
"type": "?",
"value": 1234
},
{
"exception": "Expected \\?, got String foobar",
"type": "?",
"value": "foobar"
}
]
}

@@ -25,2 +25,3 @@ /* global describe, it */

fixtures.invalid.forEach(function (f) {
assert(f.exception)
var actualValue = f.custom ? CUSTOM_TYPES[f.custom] : f.value

@@ -27,0 +28,0 @@

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