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.9.4 to 1.10.0

8

extra.js

@@ -27,3 +27,3 @@ var errors = require('./errors')

function HexN (length) {
function _HexN (length) {
return function HexN (value) {

@@ -36,2 +36,5 @@ return Hex(value) && value.length === length

function Finite (value) {
return typeof value === 'number' && isFinite(value)
}
function Int8 (value) { return ((value << 24) >> 24) === value }

@@ -53,4 +56,5 @@ function Int16 (value) { return ((value << 16) >> 16) === value }

BufferN: _BufferN,
Finite: Finite,
Hex: Hex,
HexN: HexN,
HexN: _HexN,
Int8: Int8,

@@ -57,0 +61,0 @@ Int16: Int16,

@@ -214,2 +214,17 @@ var errors = require('./errors')

// async wrapper
function __async (type, value, strict, callback) {
// default to falsy strict if using shorthand overload
if (typeof strict === 'function') return __async(type, value, false, strict)
try {
typeforce(type, value, strict)
} catch (e) {
return callback(e)
}
callback()
}
typeforce.async = __async
typeforce.compile = compile

@@ -216,0 +231,0 @@ typeforce.TfTypeError = TfTypeError

{
"name": "typeforce",
"version": "1.9.4",
"version": "1.10.0",
"description": "Another biased type checking solution for Javascript",

@@ -5,0 +5,0 @@ "keywords": [

@@ -14,13 +14,13 @@ var tape = require('tape')

tape('passes ' + typeDescription + ' with ' + valueDescription, function (t) {
t.plan(1)
t.doesNotThrow(function () {
typeforce(type, value, f.strict)
})
t.plan(2)
t.doesNotThrow(function () { typeforce(type, value, f.strict) })
typeforce.async(type, value, f.strict, t.ifErr)
})
tape('passes ' + typeDescription + ' (compiled) with ' + valueDescription, function (t) {
t.plan(1)
t.doesNotThrow(function () {
typeforce(typeforce.compile(type), value, f.strict)
})
var compiled = typeforce.compile(type)
t.plan(2)
t.doesNotThrow(function () { typeforce(compiled, value, f.strict) })
typeforce.async(compiled, value, f.strict, t.ifErr)
})

@@ -27,0 +27,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