whoops 4.1.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,12 +1,8 @@
1
1
  # whoops
2
2
 
3
3
  ![Last version](https://img.shields.io/github/tag/Kikobeats/whoops.svg?style=flat-square)
4
- [![Build Status](http://img.shields.io/travis/Kikobeats/whoops/master.svg?style=flat-square)](https://travis-ci.org/Kikobeats/whoops)
5
4
  [![Coverage Status](https://img.shields.io/coveralls/Kikobeats/whoops.svg?style=flat-square)](https://coveralls.io/github/Kikobeats/whoops)
6
- [![Dependency status](http://img.shields.io/david/Kikobeats/whoops.svg?style=flat-square)](https://david-dm.org/Kikobeats/whoops)
7
- [![Dev Dependencies Status](http://img.shields.io/david/dev/Kikobeats/whoops.svg?style=flat-square)](https://david-dm.org/Kikobeats/whoops#info=devDependencies)
8
5
  [![NPM Status](http://img.shields.io/npm/dm/whoops.svg?style=flat-square)](https://www.npmjs.org/package/whoops)
9
- [![Donate](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square)](https://paypal.me/kikobeats)
10
6
 
11
7
  > It makes simple throw qualified errors. Inspired in [errno](https://github.com/rvagg/node-errno), [create-error-class](https://github.com/floatdrop/create-error-class) and [fault](https://github.com/wooorm/fault).
12
8
 
@@ -132,6 +128,12 @@ switch (err.name) {
132
128
  };
133
129
  ```
134
130
 
131
+ ## Related
132
+
133
+ - [create-error-class](https://github.com/floatdrop/create-error-class) – Create error class.
134
+ - [fault](https://github.com/wooorm/fault) – Functional errors with formatted output.
135
+
136
+
135
137
  ## License
136
138
 
137
139
  MIT © [Kiko Beats](http://www.kikobeats.com)
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- const {isFunction, composeErrorMessage} = require('./helpers')
3
+ const { isFunction, composeErrorMessage } = require('./helpers')
4
4
 
5
5
  function interfaceObject (error, ...props) {
6
6
  Object.assign(error, ...props)
@@ -8,8 +8,8 @@ function interfaceObject (error, ...props) {
8
8
  error.description = isFunction(error.message) ? error.message(error) : error.message
9
9
 
10
10
  error.message = error.code
11
- ? composeErrorMessage(error.code, error.description)
12
- : error.description
11
+ ? composeErrorMessage(error.code, error.description)
12
+ : error.description
13
13
  }
14
14
 
15
15
  module.exports = interfaceObject
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- const {inherits} = require('./helpers')
3
+ const { inherits } = require('./helpers')
4
4
  const mimicFn = require('mimic-fn')
5
5
 
6
6
  const REGEX_CLASS_NAME = /[^0-9a-zA-Z_$]/
@@ -21,7 +21,9 @@ function createError (className) {
21
21
  writable: true
22
22
  })
23
23
 
24
- Error.captureStackTrace(this, this.constructor)
24
+ if ('captureStackTrace' in Error) {
25
+ Error.captureStackTrace(this, this.constructor)
26
+ }
25
27
  }
26
28
 
27
29
  inherits(ErrorClass, Error)
@@ -4,12 +4,12 @@ const cleanStack = require('clean-stack')
4
4
  const mimicFn = require('mimic-fn')
5
5
 
6
6
  const addErrorProps = require('./add-error-props')
7
- const {isString} = require('./helpers')
7
+ const { isString } = require('./helpers')
8
8
 
9
9
  function createExtendError (ErrorClass, classProps) {
10
10
  function ExtendError (props) {
11
11
  const error = new ErrorClass()
12
- const errorProps = isString(props) ? {message: props} : props
12
+ const errorProps = isString(props) ? { message: props } : props
13
13
  addErrorProps(error, classProps, errorProps)
14
14
 
15
15
  error.stack = cleanStack(error.stack)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "whoops",
3
3
  "description": "It makes simple throw qualified errors.",
4
4
  "homepage": "https://github.com/Kikobeats/whoops",
5
- "version": "4.1.0",
5
+ "version": "4.1.1",
6
6
  "main": "lib/index.js",
7
7
  "author": {
8
8
  "email": "josefrancisco.verdu@gmail.com",
@@ -24,15 +24,26 @@
24
24
  "throw"
25
25
  ],
26
26
  "dependencies": {
27
- "clean-stack": "~2.2.0",
28
- "mimic-fn": "~3.0.0"
27
+ "clean-stack": "~3.0.0",
28
+ "mimic-fn": "~3.1.0"
29
29
  },
30
30
  "devDependencies": {
31
- "coveralls": "latest",
31
+ "@commitlint/cli": "latest",
32
+ "@commitlint/config-conventional": "latest",
33
+ "c8": "latest",
34
+ "ci-publish": "latest",
35
+ "conventional-github-releaser": "latest",
36
+ "finepack": "latest",
37
+ "git-authors-cli": "latest",
32
38
  "mocha": "latest",
33
- "nyc": "latest",
39
+ "nano-staged": "latest",
40
+ "npm-check-updates": "latest",
41
+ "prettier-standard": "latest",
34
42
  "should": "latest",
35
- "standard": "latest"
43
+ "simple-git-hooks": "latest",
44
+ "standard": "latest",
45
+ "standard-markdown": "latest",
46
+ "standard-version": "latest"
36
47
  },
37
48
  "engines": {
38
49
  "node": ">= 8"
@@ -42,12 +53,40 @@
42
53
  ],
43
54
  "scripts": {
44
55
  "clean": "rm -rf node_modules",
56
+ "contributors": "(git-authors-cli && finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
45
57
  "coveralls": "nyc report --reporter=text-lcov | coveralls",
46
58
  "lint": "standard lib",
59
+ "postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)",
60
+ "prerelease": "npm run update:check && npm run contributors",
47
61
  "pretest": "npm run lint",
48
- "test": "nyc mocha"
62
+ "release": "standard-version -a",
63
+ "release:github": "conventional-github-releaser -p angular",
64
+ "release:tags": "git push --follow-tags origin HEAD:master",
65
+ "test": "c8 mocha",
66
+ "update": "ncu -u",
67
+ "update:check": "ncu -- --error-level 2"
49
68
  },
50
69
  "license": "MIT",
70
+ "commitlint": {
71
+ "extends": [
72
+ "@commitlint/config-conventional"
73
+ ]
74
+ },
75
+ "nano-staged": {
76
+ "*.js": [
77
+ "prettier-standard"
78
+ ],
79
+ "*.md": [
80
+ "standard-markdown"
81
+ ],
82
+ "package.json": [
83
+ "finepack"
84
+ ]
85
+ },
86
+ "simple-git-hooks": {
87
+ "commit-msg": "npx commitlint --edit",
88
+ "pre-commit": "npx nano-staged"
89
+ },
51
90
  "standard": {
52
91
  "env": "mocha"
53
92
  }
package/CHANGELOG.md DELETED
@@ -1,263 +0,0 @@
1
- ## 4.1.0 (2019-12-15)
2
-
3
- * build: update dependencies ([af7e392](https://github.com/kikobeats/whoops/commit/af7e392))
4
- * fix(package): update clean-stack to version 2.1.0 ([3275e3c](https://github.com/kikobeats/whoops/commit/3275e3c))
5
- * fix(package): update mimic-fn to version 2.1.0 ([db95daa](https://github.com/kikobeats/whoops/commit/db95daa))
6
- * fix(package): update mimic-fn to version 3.0.0 ([e1cc912](https://github.com/kikobeats/whoops/commit/e1cc912))
7
-
8
-
9
-
10
- <a name="4.0.2"></a>
11
- ## 4.0.2 (2019-03-08)
12
-
13
- * fix(package): update clean-stack to version 2.0.0 ([24952ae](https://github.com/kikobeats/whoops/commit/24952ae))
14
- * fix(package): update mimic-fn to version 1.2.0 ([719fc26](https://github.com/kikobeats/whoops/commit/719fc26))
15
- * fix(package): update mimic-fn to version 2.0.0 ([d5c78a1](https://github.com/kikobeats/whoops/commit/d5c78a1))
16
- * Refactor ([64f751b](https://github.com/kikobeats/whoops/commit/64f751b))
17
- * Update compositor.json ([e26b0fd](https://github.com/kikobeats/whoops/commit/e26b0fd))
18
- * Update compositor.json ([da98ea7](https://github.com/kikobeats/whoops/commit/da98ea7))
19
- * Update README.md ([0228c84](https://github.com/kikobeats/whoops/commit/0228c84))
20
- * docs(readme): add Greenkeeper badge ([4e1a125](https://github.com/kikobeats/whoops/commit/4e1a125))
21
-
22
-
23
-
24
- <a name="4.0.1"></a>
25
- ## 4.0.1 (2017-08-08)
26
-
27
- * Reducing library size ([ce26a2d](https://github.com/kikobeats/whoops/commit/ce26a2d))
28
- * Update README.md ([2e71ec2](https://github.com/kikobeats/whoops/commit/2e71ec2))
29
-
30
-
31
-
32
- <a name="4.0.0"></a>
33
- # 4.0.0 (2017-08-08)
34
-
35
- * refactor ([ca6e60e](https://github.com/kikobeats/whoops/commit/ca6e60e))
36
- * Remove unnecessasry ([6ec4220](https://github.com/kikobeats/whoops/commit/6ec4220))
37
- * Support attach props into constructor ([8dd67b9](https://github.com/kikobeats/whoops/commit/8dd67b9))
38
- * Update builds ([6e6275c](https://github.com/kikobeats/whoops/commit/6e6275c))
39
- * Update docs ([515c498](https://github.com/kikobeats/whoops/commit/515c498))
40
- * Update README.md ([a0dc9b0](https://github.com/kikobeats/whoops/commit/a0dc9b0))
41
- * Update README.md ([b289826](https://github.com/kikobeats/whoops/commit/b289826))
42
- * Update README.md ([bf87a1f](https://github.com/kikobeats/whoops/commit/bf87a1f))
43
-
44
-
45
-
46
- <a name="3.1.1"></a>
47
- ## 3.1.1 (2017-07-18)
48
-
49
- * Update README.md ([4561a8b](https://github.com/kikobeats/whoops/commit/4561a8b))
50
- * docs(readme): add Greenkeeper badge ([9b93e2c](https://github.com/kikobeats/whoops/commit/9b93e2c))
51
- * chore(package): update clean-stack to version 1.2.0 ([b2cb039](https://github.com/kikobeats/whoops/commit/b2cb039))
52
- * chore(package): update clean-stack to version 1.3.0 ([12fb684](https://github.com/kikobeats/whoops/commit/12fb684))
53
-
54
-
55
-
56
- <a name="3.1.0"></a>
57
- # 3.1.0 (2016-12-19)
58
-
59
- * Add description field ([6b3b308](https://github.com/kikobeats/whoops/commit/6b3b308))
60
- * Drop node 5 from testing ([c223c7f](https://github.com/kikobeats/whoops/commit/c223c7f))
61
-
62
-
63
-
64
- <a name="3.0.3"></a>
65
- ## 3.0.3 (2016-12-19)
66
-
67
- * 80 → 100 lines ([a117bb8](https://github.com/kikobeats/whoops/commit/a117bb8))
68
- * Avoid inline regexp declaration ([2f91173](https://github.com/kikobeats/whoops/commit/2f91173))
69
- * Better docs ([591d743](https://github.com/kikobeats/whoops/commit/591d743))
70
- * Test refactor ([58fb3dc](https://github.com/kikobeats/whoops/commit/58fb3dc))
71
- * Update deps ([c0d5a49](https://github.com/kikobeats/whoops/commit/c0d5a49))
72
- * Update README.md ([c9c32f8](https://github.com/kikobeats/whoops/commit/c9c32f8))
73
-
74
-
75
-
76
- <a name="3.0.2"></a>
77
- ## 3.0.2 (2016-09-13)
78
-
79
- * chore(package): update clean-stack to version 1.0.0 ([ff0f4ce](https://github.com/kikobeats/whoops/commit/ff0f4ce))
80
- * Update ([ce66183](https://github.com/kikobeats/whoops/commit/ce66183))
81
-
82
-
83
-
84
- <a name="3.0.1"></a>
85
- ## 3.0.1 (2016-08-01)
86
-
87
- * Avoid eval for setup function name ([1ecde20](https://github.com/kikobeats/whoops/commit/1ecde20))
88
- * Remove interface string façade ([14c5932](https://github.com/kikobeats/whoops/commit/14c5932))
89
- * Remove unncessary check ([6a4d469](https://github.com/kikobeats/whoops/commit/6a4d469))
90
- * Rename extend-error → create-extend-error ([fd3726e](https://github.com/kikobeats/whoops/commit/fd3726e))
91
- * Setup Error name in constructor ([4ac076d](https://github.com/kikobeats/whoops/commit/4ac076d))
92
-
93
-
94
-
95
- <a name="3.0.0"></a>
96
- # 3.0.0 (2016-07-30)
97
-
98
- * Add clean-stack dep ([7f32385](https://github.com/kikobeats/whoops/commit/7f32385))
99
- * Drop < 4 node support ([185ae66](https://github.com/kikobeats/whoops/commit/185ae66))
100
- * Fix dep ([a87c1ea](https://github.com/kikobeats/whoops/commit/a87c1ea))
101
- * Refactor fn template ([942a189](https://github.com/kikobeats/whoops/commit/942a189))
102
- * Remove capture-stack-trace dep ([5fdae23](https://github.com/kikobeats/whoops/commit/5fdae23))
103
- * Remove string interface with 3 params ([5439d61](https://github.com/kikobeats/whoops/commit/5439d61))
104
- * Remove unnecessary dep ([78d6dac](https://github.com/kikobeats/whoops/commit/78d6dac))
105
- * Update docs ([34f5e8c](https://github.com/kikobeats/whoops/commit/34f5e8c))
106
-
107
-
108
-
109
- <a name="2.2.0"></a>
110
- # 2.2.0 (2016-07-30)
111
-
112
- * Add coverage ([1547649](https://github.com/kikobeats/whoops/commit/1547649))
113
- * Move pretty on different pkg ([3640943](https://github.com/kikobeats/whoops/commit/3640943))
114
- * Refactor scaffold ([5907391](https://github.com/kikobeats/whoops/commit/5907391))
115
- * Remove browser build ([e0e3621](https://github.com/kikobeats/whoops/commit/e0e3621))
116
-
117
-
118
-
119
- <a name="2.1.0"></a>
120
- # 2.1.0 (2016-05-19)
121
-
122
- * Add missing dependency ([b832bf0](https://github.com/kikobeats/whoops/commit/b832bf0))
123
- * Add pretty output ([a1c6e4c](https://github.com/kikobeats/whoops/commit/a1c6e4c))
124
- * Update docs ([1b6c6a8](https://github.com/kikobeats/whoops/commit/1b6c6a8))
125
- * Update README.md ([30224fe](https://github.com/kikobeats/whoops/commit/30224fe))
126
- * Update travis builds ([44e69b5](https://github.com/kikobeats/whoops/commit/44e69b5))
127
-
128
-
129
-
130
- <a name="2.0.1"></a>
131
- ## 2.0.1 (2016-02-07)
132
-
133
-
134
- * lock dependency ([9d36dd5](https://github.com/kikobeats/whoops/commit/9d36dd5))
135
-
136
-
137
-
138
- <a name="2.0.0"></a>
139
- # 2.0.0 (2016-02-03)
140
-
141
-
142
- * 2.0.0 releases ([c7ba44a](https://github.com/kikobeats/whoops/commit/c7ba44a))
143
- * Little refactor ([4fb84a1](https://github.com/kikobeats/whoops/commit/4fb84a1))
144
- * Refactor tests ([5fc36b1](https://github.com/kikobeats/whoops/commit/5fc36b1))
145
- * Setup correctly instanceof ([6436f3e](https://github.com/kikobeats/whoops/commit/6436f3e))
146
- * YEAH ([2c8b56b](https://github.com/kikobeats/whoops/commit/2c8b56b))
147
-
148
-
149
-
150
- <a name="1.1.1"></a>
151
- ## 1.1.1 (2016-01-28)
152
-
153
-
154
- * 1.1.1 releases ([60cb701](https://github.com/kikobeats/whoops/commit/60cb701))
155
- * Add standard as devDependency ([313a136](https://github.com/kikobeats/whoops/commit/313a136))
156
- * Remove lodash.forEach dep ([f5f96ee](https://github.com/kikobeats/whoops/commit/f5f96ee))
157
- * setup correctly bumped ([75d190b](https://github.com/kikobeats/whoops/commit/75d190b))
158
- * Update README.md ([ec8d39c](https://github.com/kikobeats/whoops/commit/ec8d39c))
159
- * Update README.md ([ff486b4](https://github.com/kikobeats/whoops/commit/ff486b4))
160
- * Update README.md ([23527e7](https://github.com/kikobeats/whoops/commit/23527e7))
161
-
162
-
163
-
164
- <a name="1.1.0"></a>
165
- # 1.1.0 (2016-01-14)
166
-
167
-
168
- * releases ([5fff532](https://github.com/kikobeats/whoops/commit/5fff532))
169
- * Add .create method ([1315768](https://github.com/kikobeats/whoops/commit/1315768))
170
- * Add coffe as devDependency ([ce75ae9](https://github.com/kikobeats/whoops/commit/ce75ae9))
171
- * Add custom message function in object factory ([470414c](https://github.com/kikobeats/whoops/commit/470414c))
172
- * bye coffee ([6a3a1d4](https://github.com/kikobeats/whoops/commit/6a3a1d4))
173
- * bye config ([e920003](https://github.com/kikobeats/whoops/commit/e920003))
174
- * Little tests refactor ([d3abb53](https://github.com/kikobeats/whoops/commit/d3abb53))
175
- * Update description and documentation ([0ad3cba](https://github.com/kikobeats/whoops/commit/0ad3cba))
176
- * Update scripts ([29240d2](https://github.com/kikobeats/whoops/commit/29240d2))
177
-
178
-
179
-
180
- <a name="1.0.1"></a>
181
- ## 1.0.1 (2015-11-23)
182
-
183
-
184
- * 1.0.1 releases ([56e26f2](https://github.com/kikobeats/whoops/commit/56e26f2))
185
- * Fix typos in README.md ([e9063f2](https://github.com/kikobeats/whoops/commit/e9063f2))
186
- * Merge branch 'master' of github.com:kikobeats/whoops ([a363134](https://github.com/kikobeats/whoops/commit/a363134))
187
- * Merge pull request #4 from jorrit/patch-1 ([d9156f6](https://github.com/kikobeats/whoops/commit/d9156f6))
188
- * rewrite to avoid new ([23e586b](https://github.com/kikobeats/whoops/commit/23e586b))
189
- * update to upgrade bower.json ([b18589d](https://github.com/kikobeats/whoops/commit/b18589d))
190
-
191
-
192
-
193
- <a name="1.0.0"></a>
194
- # 1.0.0 (2015-11-20)
195
-
196
-
197
- * 1.0.0 releases ([447ae1e](https://github.com/kikobeats/whoops/commit/447ae1e))
198
- * refactored and renamed ([cf2b458](https://github.com/kikobeats/whoops/commit/cf2b458))
199
- * removed extra spaces ([931245d](https://github.com/kikobeats/whoops/commit/931245d))
200
- * updated ([9bf0fde](https://github.com/kikobeats/whoops/commit/9bf0fde))
201
- * updated bumped config ([4583c59](https://github.com/kikobeats/whoops/commit/4583c59))
202
- * updated dependencies ([3d7ec1b](https://github.com/kikobeats/whoops/commit/3d7ec1b))
203
- * updated documentation ([6ea514b](https://github.com/kikobeats/whoops/commit/6ea514b))
204
- * updated renaming ([4b9306c](https://github.com/kikobeats/whoops/commit/4b9306c))
205
- * updated travis builds ([a330eae](https://github.com/kikobeats/whoops/commit/a330eae))
206
-
207
-
208
-
209
- <a name="0.2.0"></a>
210
- # 0.2.0 (2015-10-01)
211
-
212
-
213
- * 0.2.0 releases ([aff1849](https://github.com/kikobeats/whoops/commit/aff1849))
214
- * Added format for string constructor ([d584188](https://github.com/kikobeats/whoops/commit/d584188))
215
- * improve example ([aa2d318](https://github.com/kikobeats/whoops/commit/aa2d318))
216
- * little suite of tests 😁 ([5e11def](https://github.com/kikobeats/whoops/commit/5e11def))
217
- * Update package.json ([1120535](https://github.com/kikobeats/whoops/commit/1120535))
218
- * updated ([d5fc2d9](https://github.com/kikobeats/whoops/commit/d5fc2d9))
219
-
220
-
221
-
222
- <a name="0.1.3"></a>
223
- ## 0.1.3 (2015-07-28)
224
-
225
-
226
- * 0.1.3 releases ([e0de222](https://github.com/kikobeats/whoops/commit/e0de222))
227
- * fixed devDependencies ([bccbf41](https://github.com/kikobeats/whoops/commit/bccbf41))
228
- * updated bumped settings ([67ff23e](https://github.com/kikobeats/whoops/commit/67ff23e))
229
-
230
-
231
-
232
- <a name="0.1.2"></a>
233
- ## 0.1.2 (2015-07-28)
234
-
235
-
236
- * 0.1.2 releases ([7273df6](https://github.com/kikobeats/whoops/commit/7273df6))
237
-
238
-
239
-
240
- <a name="0.1.1"></a>
241
- ## 0.1.1 (2015-07-28)
242
-
243
-
244
- * 0.1.1 release ([6fcf6d7](https://github.com/kikobeats/whoops/commit/6fcf6d7))
245
- * 0.1.1 releases ([15d607b](https://github.com/kikobeats/whoops/commit/15d607b))
246
- * Update README.md ([d5e55b8](https://github.com/kikobeats/whoops/commit/d5e55b8))
247
- * Update README.md ([869be0a](https://github.com/kikobeats/whoops/commit/869be0a))
248
- * Update README.md ([8344dab](https://github.com/kikobeats/whoops/commit/8344dab))
249
- * updated dependencies ([afe3a10](https://github.com/kikobeats/whoops/commit/afe3a10))
250
-
251
-
252
-
253
- <a name="0.1.0"></a>
254
- # 0.1.0 (2015-07-26)
255
-
256
-
257
- * 0.1.0 releases ([594c110](https://github.com/kikobeats/whoops/commit/594c110))
258
- * added documentation and more examples ([3e68abb](https://github.com/kikobeats/whoops/commit/3e68abb))
259
- * first approach ([c52341b](https://github.com/kikobeats/whoops/commit/c52341b))
260
- * Update README.md ([e7172ab](https://github.com/kikobeats/whoops/commit/e7172ab))
261
-
262
-
263
-