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

blork

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blork - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

1

lib/checkers.js

@@ -79,1 +79,2 @@ // Primatives.

exports["regex"] = exports["regexp"] = v => v instanceof RegExp || "Must be a regular expression";
exports["any"] = exports["mixed"] = () => true;

2

package.json
{
"name": "blork",
"description": "Blork! Mini runtime type checking in Javascript",
"version": "3.1.0",
"version": "3.2.0",
"license": "0BSD",

@@ -6,0 +6,0 @@ "author": "Dave Houlbrooke <dave@shax.com>",

@@ -251,3 +251,4 @@ # Blork! Mini runtime type checking in Javascript

| `array+`, `arr+` | Plain instances of **Array** with one or more items
| `arraylike` | Any object inheriting **Array**
| `arraylike` | Any object, not just arrays, with numeric **.length** property
| `arguments`, `args` | Arguments objects (any object, not just arrays, with numeric **.length** property)
| `map` | Instances of **Map**

@@ -263,3 +264,4 @@ | `map+` | Instances of **Map** with one or more items

| `date-`, `past` | Instances of **Date** with a value in the past
| `arguments`, `args` | Arguments (any object, not just arrays, with numeric **.length** property)
| `regex`, `regexp` | Instances of **RegExp** (regular expressions)
| `any`, `mixed` | Allow any value (transparently passes through with no error)

@@ -266,0 +268,0 @@ ```js

@@ -90,2 +90,4 @@ const BlorkError = require("../lib/BlorkError");

expect(check(/[abc]+/g, "regex")).toBe(1);
expect(check(false, "any")).toBe(1);
expect(check("abc", "mixed")).toBe(1);
});

@@ -175,2 +177,4 @@ test("Throw TypeError when checks fail (string format)", () => {

expect(() => check("/[abc]+/g", "regex")).toThrow(TypeError);
expect(check(false, "any")).toBe(1);
expect(check("abc", "mixed")).toBe(1);
});

@@ -177,0 +181,0 @@ test("Return correctly when checks pass (optional string format)", () => {

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