diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/es6-error | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) | |
download | wallet-core-bbff7403fbf46f9ad92240ac213df8d30ef31b64.tar.xz |
update packages
Diffstat (limited to 'node_modules/es6-error')
-rw-r--r-- | node_modules/es6-error/.editorconfig | 7 | ||||
-rw-r--r-- | node_modules/es6-error/.npmignore | 1 | ||||
-rw-r--r-- | node_modules/es6-error/.travis.yml | 7 | ||||
-rw-r--r-- | node_modules/es6-error/README.md | 4 | ||||
-rw-r--r-- | node_modules/es6-error/babel-config.js | 31 | ||||
-rw-r--r-- | node_modules/es6-error/bower.json | 22 | ||||
-rw-r--r-- | node_modules/es6-error/lib/index.d.ts | 1 | ||||
-rw-r--r-- | node_modules/es6-error/lib/index.jsnext.js | 72 | ||||
-rw-r--r-- | node_modules/es6-error/lib/index.ts.js | 78 | ||||
-rw-r--r-- | node_modules/es6-error/package.json | 40 | ||||
-rw-r--r-- | node_modules/es6-error/src/index.js | 34 | ||||
-rw-r--r-- | node_modules/es6-error/test/index.js | 64 |
12 files changed, 27 insertions, 334 deletions
diff --git a/node_modules/es6-error/.editorconfig b/node_modules/es6-error/.editorconfig deleted file mode 100644 index 221883624..000000000 --- a/node_modules/es6-error/.editorconfig +++ /dev/null @@ -1,7 +0,0 @@ -[*] -insert_final_newline = true -indent_style = space -indent_size = 2 -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true diff --git a/node_modules/es6-error/.npmignore b/node_modules/es6-error/.npmignore deleted file mode 100644 index 166f3fa9f..000000000 --- a/node_modules/es6-error/.npmignore +++ /dev/null @@ -1 +0,0 @@ -.babelrc
diff --git a/node_modules/es6-error/.travis.yml b/node_modules/es6-error/.travis.yml deleted file mode 100644 index 7994fafec..000000000 --- a/node_modules/es6-error/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: - - "stable" - - "4.1" - - "4.0" - - "0.10" - diff --git a/node_modules/es6-error/README.md b/node_modules/es6-error/README.md index 30c95dbbc..8a8f13086 100644 --- a/node_modules/es6-error/README.md +++ b/node_modules/es6-error/README.md @@ -49,6 +49,10 @@ util.inherits(MyError, ExtendableError); module.exports = MyError; ``` +### Known Issues + +- Uglification can obscure error class names ([#31](https://github.com/bjyoungblood/es6-error/issues/31#issuecomment-301128220)) + #### Todo - Better browser compatibility diff --git a/node_modules/es6-error/babel-config.js b/node_modules/es6-error/babel-config.js deleted file mode 100644 index a932d5db9..000000000 --- a/node_modules/es6-error/babel-config.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -var plugins = [ - [ - "babel-plugin-transform-builtin-extend", - { - "globals": ["Error"], - "approximate": true - } - ] -]; - -var env = process.env.BABEL_ENV || process.env.NODE_ENV; - -var modules; - -if (env === 'es') { - modules = false; -} else if (env === 'ts') { - modules = 'commonjs'; -} else { - modules = 'commonjs'; - plugins.push('add-module-exports'); -} - -module.exports = { - "presets": [ - ["es2015", { modules: modules }] - ], - "plugins": plugins -}; diff --git a/node_modules/es6-error/bower.json b/node_modules/es6-error/bower.json deleted file mode 100644 index 9a6f0fa9b..000000000 --- a/node_modules/es6-error/bower.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "es6-error", - "description": "Easily-extendable error for use with ES6 classes", - "main": "dist/index.js", - "authors": [ - "Ben Youngblood" - ], - "license": "MIT", - "keywords": [ - "es6", - "error", - "babel" - ], - "homepage": "https://github.com/bjyoungblood/es6-error", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/node_modules/es6-error/lib/index.d.ts b/node_modules/es6-error/lib/index.d.ts deleted file mode 100644 index c1b1f12f8..000000000 --- a/node_modules/es6-error/lib/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default class ExtendableError extends Error { } diff --git a/node_modules/es6-error/lib/index.jsnext.js b/node_modules/es6-error/lib/index.jsnext.js deleted file mode 100644 index 70fbfbcfd..000000000 --- a/node_modules/es6-error/lib/index.jsnext.js +++ /dev/null @@ -1,72 +0,0 @@ -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function _extendableBuiltin(cls) { - function ExtendableBuiltin() { - cls.apply(this, arguments); - } - - ExtendableBuiltin.prototype = Object.create(cls.prototype, { - constructor: { - value: cls, - enumerable: false, - writable: true, - configurable: true - } - }); - - if (Object.setPrototypeOf) { - Object.setPrototypeOf(ExtendableBuiltin, cls); - } else { - ExtendableBuiltin.__proto__ = cls; - } - - return ExtendableBuiltin; -} - -var ExtendableError = function (_extendableBuiltin2) { - _inherits(ExtendableError, _extendableBuiltin2); - - function ExtendableError() { - var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - - _classCallCheck(this, ExtendableError); - - // extending Error is weird and does not propagate `message` - var _this = _possibleConstructorReturn(this, (ExtendableError.__proto__ || Object.getPrototypeOf(ExtendableError)).call(this, message)); - - Object.defineProperty(_this, 'message', { - configurable: true, - enumerable: false, - value: message, - writable: true - }); - - Object.defineProperty(_this, 'name', { - configurable: true, - enumerable: false, - value: _this.constructor.name, - writable: true - }); - - if (Error.hasOwnProperty('captureStackTrace')) { - Error.captureStackTrace(_this, _this.constructor); - return _possibleConstructorReturn(_this); - } - - Object.defineProperty(_this, 'stack', { - configurable: true, - enumerable: false, - value: new Error(message).stack, - writable: true - }); - return _this; - } - - return ExtendableError; -}(_extendableBuiltin(Error)); - -export default ExtendableError; diff --git a/node_modules/es6-error/lib/index.ts.js b/node_modules/es6-error/lib/index.ts.js deleted file mode 100644 index ad1920c58..000000000 --- a/node_modules/es6-error/lib/index.ts.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function _extendableBuiltin(cls) { - function ExtendableBuiltin() { - cls.apply(this, arguments); - } - - ExtendableBuiltin.prototype = Object.create(cls.prototype, { - constructor: { - value: cls, - enumerable: false, - writable: true, - configurable: true - } - }); - - if (Object.setPrototypeOf) { - Object.setPrototypeOf(ExtendableBuiltin, cls); - } else { - ExtendableBuiltin.__proto__ = cls; - } - - return ExtendableBuiltin; -} - -var ExtendableError = function (_extendableBuiltin2) { - _inherits(ExtendableError, _extendableBuiltin2); - - function ExtendableError() { - var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - - _classCallCheck(this, ExtendableError); - - // extending Error is weird and does not propagate `message` - var _this = _possibleConstructorReturn(this, (ExtendableError.__proto__ || Object.getPrototypeOf(ExtendableError)).call(this, message)); - - Object.defineProperty(_this, 'message', { - configurable: true, - enumerable: false, - value: message, - writable: true - }); - - Object.defineProperty(_this, 'name', { - configurable: true, - enumerable: false, - value: _this.constructor.name, - writable: true - }); - - if (Error.hasOwnProperty('captureStackTrace')) { - Error.captureStackTrace(_this, _this.constructor); - return _possibleConstructorReturn(_this); - } - - Object.defineProperty(_this, 'stack', { - configurable: true, - enumerable: false, - value: new Error(message).stack, - writable: true - }); - return _this; - } - - return ExtendableError; -}(_extendableBuiltin(Error)); - -exports.default = ExtendableError; diff --git a/node_modules/es6-error/package.json b/node_modules/es6-error/package.json index 72c306d92..c5782a539 100644 --- a/node_modules/es6-error/package.json +++ b/node_modules/es6-error/package.json @@ -1,17 +1,22 @@ { "name": "es6-error", - "version": "4.0.2", + "version": "4.1.1", "description": "Easily-extendable error for use with ES6 classes", "main": "./lib/index", - "jsnext:main": "./lib/index.jsnext.js", - "typings": "./lib/index.d.ts", + "module": "./es6/index.js", + "typings": "./typings/index.d.ts", + "files": [ + "lib", + "es6", + "typings" + ], "scripts": { - "test": "mocha --compilers js:babel-core/register --recursive", - "build": "npm run build:commonjs && npm run build:es && npm run build:ts", - "build:commonjs": "cross-env BABEL_ENV=commonjs babel src/index.js --out-file lib/index.js", - "build:es": "cross-env BABEL_ENV=es babel src/index.js --out-file lib/index.jsnext.js", - "build:ts": "cross-env BABEL_ENV=ts babel src/index.js --out-file lib/index.ts.js", - "prepublish": "npm run build && npm run test" + "test": "cross-env BABEL_ENV=test mocha --require babel-core/register --recursive", + "clean": "rimraf lib es6", + "build": "npm run clean && npm run build:cjs && npm run build:es6", + "build:cjs": "mkdir -p lib && cross-env BABEL_ENV=cjs babel src/index.js -o lib/index.js", + "build:es6": "mkdir -p es6 && cross-env BABEL_ENV=es6 babel src/index.js -o es6/index.js", + "prepublishOnly": "npm run build && npm run test" }, "repository": { "type": "git", @@ -29,14 +34,15 @@ }, "homepage": "https://github.com/bjyoungblood/es6-error", "devDependencies": { - "babel-cli": "^6.8.0", - "babel-core": "^6.8.0", - "babel-plugin-add-module-exports": "^0.1.4", - "babel-plugin-transform-builtin-extend": "^1.1.0", - "babel-preset-es2015": "^6.6.0", - "chai": "^3.2.0", - "cross-env": "^2.0.1", - "mocha": "^2.4.5" + "babel-cli": "^6.26.0", + "babel-core": "^6.26.0", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-transform-builtin-extend": "^1.1.2", + "babel-preset-env": "^1.6.1", + "chai": "^4.1.2", + "cross-env": "^5.1.1", + "mocha": "^4.0.1", + "rimraf": "^2.6.2" }, "dependencies": {} } diff --git a/node_modules/es6-error/src/index.js b/node_modules/es6-error/src/index.js deleted file mode 100644 index e52b1613c..000000000 --- a/node_modules/es6-error/src/index.js +++ /dev/null @@ -1,34 +0,0 @@ -class ExtendableError extends Error { - constructor(message = '') { - super(message); - - // extending Error is weird and does not propagate `message` - Object.defineProperty(this, 'message', { - configurable: true, - enumerable : false, - value : message, - writable : true, - }); - - Object.defineProperty(this, 'name', { - configurable: true, - enumerable : false, - value : this.constructor.name, - writable : true, - }); - - if (Error.hasOwnProperty('captureStackTrace')) { - Error.captureStackTrace(this, this.constructor); - return; - } - - Object.defineProperty(this, 'stack', { - configurable: true, - enumerable : false, - value : (new Error(message)).stack, - writable : true, - }); - } -} - -export default ExtendableError; diff --git a/node_modules/es6-error/test/index.js b/node_modules/es6-error/test/index.js deleted file mode 100644 index 7e98e2de5..000000000 --- a/node_modules/es6-error/test/index.js +++ /dev/null @@ -1,64 +0,0 @@ -import { expect } from 'chai'; -import ExtendableError from '../src/index'; - -class TestError extends ExtendableError {} -class SubTestError extends TestError {} - -describe('ExtendableError', () => { - it('instance of', () => { - let err = new ExtendableError(); - expect(err).to.be.an.instanceof(Error); - expect(err).to.be.an.instanceof(ExtendableError); - - let err2 = new TestError(); - expect(err2).to.be.an.instanceof(Error); - expect(err2).to.be.an.instanceof(ExtendableError); - expect(err2).to.be.an.instanceof(TestError); - - let err3 = new SubTestError(); - expect(err3).to.be.an.instanceof(Error); - expect(err3).to.be.an.instanceof(ExtendableError); - expect(err3).to.be.an.instanceof(TestError); - expect(err3).to.be.an.instanceof(SubTestError); - }); - - it('.name', () => { - let err = new ExtendableError(); - expect(err.name).to.equal('ExtendableError'); - - let err2 = new TestError(); - expect(err2.name).to.equal('TestError'); - - let err3 = new SubTestError(); - expect(err3.name).to.equal('SubTestError'); - }); - - it('name is not enumerable', () => { - let err = new ExtendableError(); - expect(err.propertyIsEnumerable('name')).to.be.false; - }); - - it('.stack', () => { - let err = new ExtendableError(); - expect(err.stack).to.be.a('string'); - - let err2 = new TestError(); - expect(err2.stack).to.be.a('string'); - }); - - it('#toString', () => { - let err = new ExtendableError(); - expect(err.toString()).to.equal('ExtendableError'); - - let err2 = new TestError(); - expect(err2.toString()).to.equal('TestError'); - - let err3 = new SubTestError(); - expect(err3.toString()).to.equal('SubTestError'); - }); - - it('.message', () => { - let err = new ExtendableError('error occurred'); - expect(err.message).to.equal('error occurred'); - }) -}); |