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 8.3.2 to 8.3.3

40

lib/modifiers/modifiers.js

@@ -16,2 +16,22 @@ const debug = require("../helpers/debug");

module.exports = [
// Return type.
// Changes error message from e.g. "Must be string" to "Must return string"
{
start: "return ",
callback(type, find) {
// Get normal checker.
const valueChecker = find(type);
// Create a checker.
const checker = v => valueChecker(v);
// Checker settings.
checker.desc = valueChecker.desc;
checker.prefix = "Must return";
// Return it.
return checker;
}
},
// AND combined type, e.g. `upper & str`

@@ -434,23 +454,3 @@ {

}
},
// Return type.
// Changes error message from e.g. "Must be string" to "Must return string"
{
start: "return ",
callback(type, find) {
// Get normal checker.
const valueChecker = find(type);
// Create a checker.
const checker = v => valueChecker(v);
// Checker settings.
checker.desc = valueChecker.desc;
checker.prefix = "Must return";
// Return it.
return checker;
}
}
];
{
"name": "blork",
"description": "Blork! Mini runtime type checking in Javascript",
"version": "8.3.2",
"version": "8.3.3",
"license": "0BSD",

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

@@ -455,3 +455,6 @@ const BlorkError = require("../../lib/errors/BlorkError");

});
test("Return type has highest precedence", () => {
expect(() => check(123, "return str+ | boolean")).toThrow(/Must return \(non-empty string\) or boolean/);
});
});
});
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