🚀. Socket Launch Week Day 3:Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions.Learn more
Sign In

@truffle/error

Package Overview
Dependencies
Maintainers
11
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@truffle/error - npm Package Compare versions

Comparing version
0.0.15-alphaTez.3
to
0.0.15
+4
dist/src/index.d.ts
declare class ExtendableError extends Error {
constructor(message: string);
}
export = ExtendableError;
"use strict";
//Note: This class only exists for compatibility with some old Javascript
//stuff that avoided using Error directly for whatever reason. Eventually
//it should be eliminated.
class ExtendableError extends Error {
constructor(message) {
super(message);
this.name = this.constructor.name;
}
}
module.exports = ExtendableError;
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,yEAAyE;AACzE,0EAA0E;AAC1E,0BAA0B;AAC1B,MAAM,eAAgB,SAAQ,KAAK;IACjC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AAED,iBAAS,eAAe,CAAC"}
+19
-5
{
"name": "@truffle/error",
"version": "0.0.15-alphaTez.3",
"version": "0.0.15",
"description": "Simple module that allows native Error objects to be extended",
"main": "index.js",
"scripts": {},
"repository": "https://github.com/trufflesuite/truffle/tree/master/packages/error",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "tsc",
"prepare": "yarn build"
},
"repository": {
"type": "git",
"url": "https://github.com/trufflesuite/truffle.git",
"directory": "packages/error"
},
"keywords": [

@@ -23,3 +34,6 @@ "ethereum",

},
"gitHead": "d29ebd9d610cf07fbd046b0a19bd6113916f7ad3"
"devDependencies": {
"typescript": "^4.1.4"
},
"gitHead": "017e84fbad1f53f62db00483cb07fad0471e750f"
}
sudo: required
language: generic
services:
- docker
before_install:
- docker pull truffle/ci
env:
- TEST=repo
- TEST=upstream
- TEST=scenario
script:
- >
docker run -it --rm --name ${TEST} \
-e TRAVIS_REPO_SLUG \
-e TRAVIS_PULL_REQUEST \
-e TRAVIS_PULL_REQUEST_SLUG \
-e TRAVIS_PULL_REQUEST_BRANCH \
-e TRAVIS_BRANCH \
-e TEST \
truffle/ci:latest run_tests
// From here:
// https://phabricator.babeljs.io/T3083
//
// Turns out I was doing some bad things, but for now I'm going to
// keep on doing them. TODO: Stop it.
function ExtendableBuiltin(cls) {
function ExtendableBuiltin() {
cls.apply(this, arguments);
}
ExtendableBuiltin.prototype = Object.create(cls.prototype);
Object.setPrototypeOf(ExtendableBuiltin, cls);
return ExtendableBuiltin;
}
module.exports = ExtendableBuiltin;
var ExtendableBuiltin = require("./extendablebuiltin");
var inherits = require("util").inherits;
inherits(ExtendableError, ExtendableBuiltin(Error));
// From: http://stackoverflow.com/questions/31089801/extending-error-in-javascript-with-es6-syntax
function ExtendableError(message) {
ExtendableError.super_.call(this);
this.message = message;
this.stack = new Error(message).stack;
this.name = this.constructor.name;
}
// Hack. Likely won't be formatted correctly when there are
// 10 or more errors. But if there's 10 or more errors, I'm guessing
// formatting won't matter so much.
ExtendableError.prototype.formatForMocha = function() {
this.message = this.message.replace(/\n/g, "\n ");
};
module.exports = ExtendableError;