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

@paladen/errors

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paladen/errors - npm Package Compare versions

Comparing version 1.6.11 to 1.9.3

67

dist/index.js

@@ -5,2 +5,8 @@ 'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var React = _interopDefault(require('react'));
var PropTypes = _interopDefault(require('prop-types'));
var reactBootstrap = require('react-bootstrap');
function _classCallCheck(instance, Constructor) {

@@ -12,2 +18,61 @@ if (!(instance instanceof Constructor)) {

var __jsx = React.createElement;
var GenericErrors = function GenericErrors(_ref) {
var errors = _ref.errors;
return __jsx(reactBootstrap.Alert, {
variant: "danger"
}, errors.map(function (error) {
return __jsx("div", {
key: error.name
}, error.message);
}));
};
GenericErrors.propTypes = {
errors: PropTypes.arrayOf(PropTypes.shape({
name: PropTypes.string.isRequired,
message: PropTypes.string.isRequired
}))
};
var __jsx$1 = React.createElement;
var FormErrors = function FormErrors(_ref) {
var errors = _ref.errors,
field = _ref.field,
includingFields = _ref.includingFields;
// Errors for a specific form field
if (field) {
var _fieldErrors = fieldErrors(errors, field);
if (!_fieldErrors.length) return null;
return __jsx$1(reactBootstrap.Form.Control.Feedback, {
type: "invalid"
}, _fieldErrors.map(function (error) {
return __jsx$1("div", {
key: error.name
}, error.message);
}));
} // Generic errors
var _genericErrors = genericErrors(errors, includingFields);
if (!_genericErrors.length) return null;
return __jsx$1(GenericErrors, {
errors: _genericErrors
});
};
FormErrors.propTypes = {
errors: PropTypes.arrayOf(PropTypes.shape({
name: PropTypes.string.isRequired,
message: PropTypes.string.isRequired
})),
field: PropTypes.string,
includingFields: PropTypes.arrayOf(PropTypes.string)
};
var BaseError = function BaseError(props) {

@@ -60,4 +125,6 @@ _classCallCheck(this, BaseError);

exports.BaseError = BaseError;
exports.FormErrors = FormErrors;
exports.GenericErrors = GenericErrors;
exports.createErrorResponseArray = createErrorResponseArray;
exports.fieldErrors = fieldErrors;
exports.genericErrors = genericErrors;

16

package.json
{
"name": "@paladen/errors",
"version": "1.6.11",
"version": "1.9.3",
"repository": "https://github.com/samstr/paladen",

@@ -18,3 +18,15 @@ "main": "dist/index.js",

},
"gitHead": "6ff561fe8994c6a558ebb0145980fe7868ae4782"
"dependencies": {
"bootstrap": "^4.4.1",
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-bootstrap": "^1.0.1",
"react-dom": "^16.13.1"
},
"peerDependencies": {
"bootstrap": "^4.4.1",
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
"gitHead": "c7a95d07b5a3020799f5ebcfa539edbb6f91828e"
}
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