Socket
Socket
Sign inDemoInstall

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.15.0 to 1.15.1

21

index.js

@@ -12,9 +12,12 @@ var ERRORS = require('./errors')

var TYPES = {
arrayOf: function arrayOf (type, arrayType) {
arrayOf: function arrayOf (type, options) {
type = compile(type)
arrayType = compile(arrayType || NATIVE.Array)
options = options || {}
function _arrayOf (array, strict) {
if (!arrayType(array)) return false
if (!NATIVE.Array(array)) return false
if (NATIVE.Nil(array)) return false
if (options.minLength !== undefined && array.length < options.minLength) return false
if (options.maxLength !== undefined && array.length > options.maxLength) return false
if (options.length !== undefined && array.length !== options.length) return false

@@ -29,3 +32,13 @@ return array.every(function (value, i) {

}
_arrayOf.toJSON = function () { return '[' + tfJSON(type) + ']' }
_arrayOf.toJSON = function () {
var str = '[' + tfJSON(type) + ']'
if (options.length !== undefined) {
str += '{' + options.length + '}'
} else if (options.minLength !== undefined || options.maxLength !== undefined) {
str += '{' +
(options.minLength === undefined ? 0 : options.minLength) + ',' +
(options.maxLength === undefined ? Infinity : options.maxLength) + '}'
}
return str
}

@@ -32,0 +45,0 @@ return _arrayOf

2

package.json
{
"name": "typeforce",
"version": "1.15.0",
"version": "1.15.1",
"description": "Another biased type checking solution for Javascript",

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

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