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

lazy-ass

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lazy-ass - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

2

bower.json
{
"name": "lazy-ass",
"main": "index.js",
"version": "0.4.0",
"version": "0.4.1",
"homepage": "https://github.com/bahmutov/lazy-ass",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -12,3 +12,10 @@ (function initLazyAss() {

if (typeof arg === 'function') {
return total + arg();
var fnResult;
try {
fnResult = arg();
} catch (err) {
// ignore the error
fnResult = '[function ' + arg.name + ' threw error!]';
}
return total + fnResult;
}

@@ -15,0 +22,0 @@ if (Array.isArray(arg)) {

{
"name": "lazy-ass",
"description": "Lazy assertions without performance penalty",
"version": "0.4.0",
"version": "0.4.1",
"author": "Gleb Bahmutov <gleb.bahmutov@gmail.com>",

@@ -6,0 +6,0 @@ "bugs": {

@@ -68,2 +68,16 @@ /* global lazyAss */

it('handles exception if thrown from function', function () {
var called = 0;
function foo() {
called += 1;
throw new Error('Oh no!');
}
expect(function () {
lazyAss(false, foo, 'bar', foo);
}).to.throwException(function (err) {
expect(called).to.equal(2);
expect(err.message).to.contain('bar');
});
});
it('JSON stringifies arrays', function () {

@@ -70,0 +84,0 @@ expect(function () {

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