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

@appliedblockchain/assert-combinators

Package Overview
Dependencies
Maintainers
15
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appliedblockchain/assert-combinators - npm Package Compare versions

Comparing version 0.0.3 to 1.0.0

defined.js

4

and.js

@@ -1,6 +0,6 @@

// @flow
// @flow strict
/*::
type $A<R> = any => R
type $A<R> = mixed => R

@@ -7,0 +7,0 @@ declare function and<A>($A<A>): $A<A>;

@@ -1,7 +0,7 @@

// @flow
// @flow strict
const any = require('./any')
const mixed = require('./mixed')
const array /*: <T>(a?: any => T) => (any => T[]) */ = /*:: <T> */
(a = any) =>
const array /*: <T>(a?: mixed => T) => (mixed => $ReadOnlyArray<T>) */ = /*:: <T> */
(a = mixed) =>
value => {

@@ -11,3 +11,3 @@ if (!Array.isArray(value)) {

}
if (a && a !== any) {
if (a && a !== mixed) {
value.every(_ => a(_))

@@ -14,0 +14,0 @@ }

@@ -1,6 +0,6 @@

// @flow
// @flow strict
const { inspect } = require('util')
const boolean /*: any => boolean */ =
const boolean /*: mixed => boolean */ =
value => {

@@ -7,0 +7,0 @@ if (typeof value !== 'boolean') {

# Changelog
## [v1.0.0](../../compare/v0.0.3...v1.0.0) (2020-03-31)
* Multiple updates.
* Adding gt, gte, lt and lte.
* Adding defined.
* Updating changelog.
## [v0.0.3](../../compare/v0.0.2...v0.0.3) (2020-03-12)

@@ -4,0 +11,0 @@

@@ -1,2 +0,2 @@

// @flow
// @flow strict

@@ -7,3 +7,3 @@ const { inspect } = require('util')

const dateString /*: any => string */ =
const dateString /*: mixed => string */ =
value => {

@@ -10,0 +10,0 @@ if (typeof value !== 'string') {

// @flow
const and = require('./and')
const any = require('./any')
const array = require('./array')
const boolean = require('./boolean')
const dateString = require('./date-string')
const defined = require('./defined')
const exact = require('./exact')
const finite = require('./finite')
const mixed = require('./mixed')
const nilOr = require('./nil-or')
const nullOr = require('./null-or')
const number = require('./number')

@@ -17,11 +20,15 @@ const object = require('./object')

const tuple = require('./tuple')
const undefinedOr = require('./undefined-or')
module.exports = {
and,
any,
array,
boolean,
dateString,
defined,
exact,
finite,
mixed,
nilOr,
nullOr,
number,

@@ -33,3 +40,4 @@ object,

taggedOr,
tuple
tuple,
undefinedOr
}

@@ -1,6 +0,6 @@

// @flow
// @flow strict
const { inspect } = require('util')
const number /*: any => number */ =
const number /*: mixed => number */ =
value => {

@@ -7,0 +7,0 @@ if (typeof value !== 'number') {

@@ -1,6 +0,6 @@

// @flow
// @flow strict
const { inspect } = require('util')
const object /*: <KV: {}>(KV) => any => $ObjMapi<KV, <K, V>(K, (...Iterable<any>) => V) => V> */ = /*:: <KV> */
const object /*: <KV: { ... }>(KV) => mixed => $ObjMapi<KV, <K, V>(K, (...Iterable<mixed>) => V) => V> */ = /*:: <KV> */
(kvs) =>

@@ -7,0 +7,0 @@ value => {

{
"name": "@appliedblockchain/assert-combinators",
"version": "0.0.3",
"version": "1.0.0",
"description": "Assertion combinators.",

@@ -18,4 +18,4 @@ "main": "index.js",

"eslint-plugin-jest": "23.8.2",
"flow-bin": "0.120.1",
"jest": "25.1.0"
"flow-bin": "0.121.0",
"jest": "25.2.4"
},

@@ -22,0 +22,0 @@ "eslintConfig": {

@@ -1,6 +0,6 @@

// @flow
// @flow string
const { inspect } = require('util')
const string /*: any => string */ =
const string /*: mixed => string */ =
value => {

@@ -7,0 +7,0 @@ if (typeof value !== 'string') {

@@ -46,4 +46,5 @@ // @flow

}
if (value.length !== as.length) {
throw new TypeError(`Expected tuple arity ${as.length}, got ${value.length} in ${inspect(value)}.`)
// TODO: Check min/max arity, trim undefined tail.
if (value.length > as.length) {
throw new TypeError(`Expected tuple arity less or equal to ${as.length}, got ${value.length} in ${inspect(value)}.`)
}

@@ -50,0 +51,0 @@ return value.map((_, i) => as[i](_))

Sorry, the diff of this file is not supported yet

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