@kaspernj/api-maker 1.0.152 → 1.0.159
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/package.json +1 -1
- package/src/custom-error.cjs +5 -1
- package/src/link.jsx +2 -2
- package/src/validation-error.cjs +5 -1
package/package.json
CHANGED
package/src/custom-error.cjs
CHANGED
|
@@ -12,7 +12,7 @@ const errorMessages = (args) => {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
class CustomError extends Error {
|
|
16
16
|
constructor (message, args = {}) {
|
|
17
17
|
let messageToUse = message
|
|
18
18
|
|
|
@@ -38,3 +38,7 @@ module.exports = class CustomError extends Error {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
+
|
|
42
|
+
CustomError.apiMakerType = "CustomError"
|
|
43
|
+
|
|
44
|
+
module.exports = CustomError
|
package/src/link.jsx
CHANGED
|
@@ -2,10 +2,10 @@ import React from "react"
|
|
|
2
2
|
|
|
3
3
|
export default class Link extends React.PureComponent {
|
|
4
4
|
render() {
|
|
5
|
-
const {to, ...restProps} = this.props
|
|
5
|
+
const {to, onClick, ...restProps} = this.props
|
|
6
6
|
|
|
7
7
|
return (
|
|
8
|
-
<a href={to} {...restProps} onClick={this.onLinkClicked} />
|
|
8
|
+
<a href={to} {...restProps} onClick={onClick || this.onLinkClicked} />
|
|
9
9
|
)
|
|
10
10
|
}
|
|
11
11
|
|
package/src/validation-error.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const CustomError = require("./custom-error.cjs")
|
|
2
2
|
const inflection = require("inflection")
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
class ValidationError extends CustomError {
|
|
5
5
|
constructor (validationErrors, args) {
|
|
6
6
|
super(validationErrors.getUnhandledErrorMessage() || validationErrors.getErrorMessage(), args)
|
|
7
7
|
this.validationErrors = validationErrors
|
|
@@ -21,3 +21,7 @@ module.exports = class ValidationError extends CustomError {
|
|
|
21
21
|
return false
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
ValidationError.apiMakerType = "CustomError"
|
|
26
|
+
|
|
27
|
+
module.exports = ValidationError
|