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.1 to 8.3.2

12

lib/errors/ValueError.js

@@ -5,2 +5,5 @@ const format = require("../helpers/format");

// Regexes.
const R_STARTS_WITH_FUNCTION = /^[a-zA-Z0-9-_.]+\(\): /;
/**

@@ -36,6 +39,9 @@ * ValueError

// Prepend the calling function name to the prefix, e.g. "name" → "MyClass.myFunc(): name"
if (!prefix) prefix = frame.function;
else if (prefix.indexOf(": ") === -1)
// Skip any prefixes that already have a ':' colon.
if (!prefix) {
// No prefix (just use function name).
prefix = frame.function;
} else if (!R_STARTS_WITH_FUNCTION.test(prefix)) {
// Skip any prefixes that already have a ':' colon by matching the regexp.
prefix = `${frame.function}: ${prefix}`;
}
}

@@ -42,0 +48,0 @@ // Update file, line, column.

{
"name": "blork",
"description": "Blork! Mini runtime type checking in Javascript",
"version": "8.3.1",
"version": "8.3.2",
"license": "0BSD",

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

@@ -85,3 +85,3 @@ const { ValueError, EMPTY } = require("../../lib/exports");

});
test("Return correct error with reason, value, and prefix (named function but with prefix including ': ' colon space)", () => {
test("Return correct error with reason, value, and prefix (named function with prefix including 'myFunc(): ' etc at the start)", () => {
function abc() {

@@ -88,0 +88,0 @@ const e = new ValueError("Reason", 123, "myFunc(): Prefix");

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