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

compilerr

Package Overview
Dependencies
Maintainers
1
Versions
184
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compilerr - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

2

package.json

@@ -23,3 +23,3 @@ {

},
"version": "0.1.0"
"version": "0.2.0"
}

@@ -78,3 +78,3 @@ 'use strict';

module.exports.compile = function compile(template, parameters) {
module.exports.compile = function compile(template, parameters, cause) {
var code,

@@ -84,2 +84,6 @@ err,

if (arguments.length === 2 && parameters instanceof Error) {
cause = parameters;
}
code = (template.code === undefined) ? undefined : renderString(template.code, parameters);

@@ -90,2 +94,6 @@ message = (template.message === undefined) ? undefined : renderString(template.message, parameters);

if (cause !== undefined) {
err.cause = cause;
}
if (code !== undefined) {

@@ -92,0 +100,0 @@ err.code = code;

@@ -109,4 +109,30 @@ 'use strict';

it('should return an error with a given cause as a third argument', function () {
var cause,
err;
cause = new Error('a fake cause');
err = compilerr.compile({}, {}, cause);
expect(err).to.be.an.instanceOf(Error);
expect(err.cause).to.equal(cause);
});
it('should return an error with a given cause as a third argument', function () {
var cause,
err;
cause = new Error('a fake cause');
err = compilerr.compile({}, cause);
expect(err).to.be.an.instanceOf(Error);
expect(err.cause).to.equal(cause);
});
});
});
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