Socket
Socket
Sign inDemoInstall

@hapi/hoek

Package Overview
Dependencies
Maintainers
6
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hapi/hoek - npm Package Compare versions

Comparing version 10.0.1 to 11.0.0

lib/errors.js

14

lib/assert.js
'use strict';
const AssertError = require('./error');
const Errors = require('./errors');
const Stringify = require('./stringify');

@@ -9,3 +10,3 @@

module.exports = function (condition, ...args) {
const assert = module.exports = function (condition, ...args) {

@@ -22,3 +23,10 @@ if (condition) {

throw new AssertError(args);
const msgs = args
.filter((arg) => arg !== '')
.map((arg) => {
return typeof arg === 'string' ? arg : arg instanceof Error ? arg.message : Stringify(arg);
});
throw new Errors.AssertError(msgs.join(' '), assert);
};

@@ -344,2 +344,11 @@ /// <reference types="node" />

/**
* Assertion Error as thrown from Hoek.assert().
*/
export class AssertError extends Error {
name: 'AssertError';
}
/**
* A benchmarking timer, using the internal node clock for maximum accuracy.

@@ -346,0 +355,0 @@ */

@@ -7,2 +7,4 @@ 'use strict';

exports.AssertError = require('./errors').AssertError;
exports.Bench = require('./bench');

@@ -18,4 +20,2 @@

exports.Error = require('./error');
exports.escapeHeaderAttribute = require('./escapeHeaderAttribute');

@@ -22,0 +22,0 @@

{
"name": "@hapi/hoek",
"description": "General purpose node utilities",
"version": "10.0.1",
"version": "11.0.0",
"repository": "git://github.com/hapijs/hoek",

@@ -6,0 +6,0 @@ "main": "lib/index.js",

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