qrcode.react
Advanced tools
Comparing version 1.0.1 to 2.0.0
'use strict'; | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
var _excluded = ["value", "size", "level", "bgColor", "fgColor", "style", "includeMargin", "imageSettings"], | ||
_excluded2 = ["value", "size", "level", "bgColor", "fgColor", "includeMargin", "imageSettings"], | ||
_excluded3 = ["renderAs"]; | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
@@ -19,13 +23,17 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
@@ -225,10 +233,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var QRCodeCanvas = | ||
/*#__PURE__*/ | ||
function (_React$PureComponent) { | ||
var QRCodeCanvas = /*#__PURE__*/function (_React$PureComponent) { | ||
_inherits(QRCodeCanvas, _React$PureComponent); | ||
var _super = _createSuper(QRCodeCanvas); | ||
function QRCodeCanvas() { | ||
var _getPrototypeOf2; | ||
var _this; | ||
@@ -242,3 +248,3 @@ | ||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(QRCodeCanvas)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
_this = _super.call.apply(_super, [this].concat(args)); | ||
@@ -272,4 +278,4 @@ _defineProperty(_assertThisInitialized(_this), "_canvas", void 0); | ||
}, { | ||
key: "componentWillReceiveProps", | ||
value: function componentWillReceiveProps(nextProps) { | ||
key: "UNSAFE_componentWillReceiveProps", | ||
value: function UNSAFE_componentWillReceiveProps(nextProps) { | ||
var _this$props$imageSett, _nextProps$imageSetti; | ||
@@ -376,3 +382,3 @@ | ||
imageSettings = _this$props2.imageSettings, | ||
otherProps = _objectWithoutProperties(_this$props2, ["value", "size", "level", "bgColor", "fgColor", "style", "includeMargin", "imageSettings"]); | ||
otherProps = _objectWithoutProperties(_this$props2, _excluded); | ||
@@ -388,3 +394,3 @@ var canvasStyle = _objectSpread({ | ||
if (imageSettings != null && imgSrc != null) { | ||
img = React.createElement("img", { | ||
img = /*#__PURE__*/React.createElement("img", { | ||
src: imgSrc, | ||
@@ -401,3 +407,3 @@ style: { | ||
return React.createElement(React.Fragment, null, React.createElement("canvas", _extends({ | ||
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("canvas", _extends({ | ||
style: canvasStyle, | ||
@@ -422,11 +428,11 @@ height: size, | ||
var QRCodeSVG = | ||
/*#__PURE__*/ | ||
function (_React$PureComponent2) { | ||
var QRCodeSVG = /*#__PURE__*/function (_React$PureComponent2) { | ||
_inherits(QRCodeSVG, _React$PureComponent2); | ||
var _super2 = _createSuper(QRCodeSVG); | ||
function QRCodeSVG() { | ||
_classCallCheck(this, QRCodeSVG); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(QRCodeSVG).apply(this, arguments)); | ||
return _super2.apply(this, arguments); | ||
} | ||
@@ -445,3 +451,3 @@ | ||
imageSettings = _this$props3.imageSettings, | ||
otherProps = _objectWithoutProperties(_this$props3, ["value", "size", "level", "bgColor", "fgColor", "includeMargin", "imageSettings"]); // We'll use type===-1 to force QRCode to automatically pick the best type | ||
otherProps = _objectWithoutProperties(_this$props3, _excluded2); // We'll use type===-1 to force QRCode to automatically pick the best type | ||
@@ -468,3 +474,3 @@ | ||
image = React.createElement("image", { | ||
image = /*#__PURE__*/React.createElement("image", { | ||
xlinkHref: imageSettings.src, | ||
@@ -486,3 +492,3 @@ height: calculatedImageSettings.h, | ||
var fgPath = generatePath(cells, margin); | ||
return React.createElement("svg", _extends({ | ||
return /*#__PURE__*/React.createElement("svg", _extends({ | ||
shapeRendering: "crispEdges", | ||
@@ -492,6 +498,6 @@ height: size, | ||
viewBox: "0 0 ".concat(numCells, " ").concat(numCells) | ||
}, otherProps), React.createElement("path", { | ||
}, otherProps), /*#__PURE__*/React.createElement("path", { | ||
fill: bgColor, | ||
d: "M0,0 h".concat(numCells, "v").concat(numCells, "H0z") | ||
}), React.createElement("path", { | ||
}), /*#__PURE__*/React.createElement("path", { | ||
fill: fgColor, | ||
@@ -514,6 +520,6 @@ d: fgPath | ||
var renderAs = props.renderAs, | ||
otherProps = _objectWithoutProperties(props, ["renderAs"]); | ||
otherProps = _objectWithoutProperties(props, _excluded3); | ||
var Component = renderAs === 'svg' ? QRCodeSVG : QRCodeCanvas; | ||
return React.createElement(Component, otherProps); | ||
return /*#__PURE__*/React.createElement(Component, otherProps); | ||
}; | ||
@@ -520,0 +526,0 @@ |
{ | ||
"name": "qrcode.react", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "React component to generate QR codes", | ||
@@ -16,6 +16,7 @@ "keywords": [ | ||
"pretty": "prettier --write '{*,.*}.{js,json}' '**/*.{js,json}'", | ||
"prepublish": "flow && make clean && make all", | ||
"prepublishOnly": "flow && make clean && make all", | ||
"prepublish-docs": "make clean && make all", | ||
"publish-docs": "gh-pages --dist=examples --src='{index.html,bundle.js}'", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "jest", | ||
"typecheck": "flow" | ||
}, | ||
@@ -37,27 +38,30 @@ "author": "Paul O’Shannessy <paul@oshannessy.com>", | ||
"peerDependencies": { | ||
"react": "^15.5.3 || ^16.0.0 || ^17.0.0" | ||
"react": "^16.3.0 || ^17.0.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0", | ||
"@babel/core": "^7.0.0", | ||
"@babel/plugin-proposal-class-properties": "^7.0.0", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0", | ||
"@babel/plugin-proposal-optional-chaining": "^7.12.7", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/preset-flow": "^7.0.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"babel-eslint": "^10.0.1", | ||
"babel-loader": "^8.0.0", | ||
"eslint": "^6.6.0", | ||
"eslint-config-prettier": "^6.5.0", | ||
"eslint-plugin-flowtype": "^4.3.0", | ||
"eslint-plugin-prettier": "^3.0.0", | ||
"eslint-plugin-react": "^7.6.1", | ||
"@babel/cli": "^7.13.14", | ||
"@babel/core": "^7.13.15", | ||
"@babel/eslint-parser": "^7.16.5", | ||
"@babel/plugin-proposal-class-properties": "^7.13.0", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.13.8", | ||
"@babel/plugin-proposal-optional-chaining": "^7.13.12", | ||
"@babel/preset-env": "^7.13.15", | ||
"@babel/preset-flow": "^7.13.13", | ||
"@babel/preset-react": "^7.13.13", | ||
"babel-loader": "^8.2.2", | ||
"eslint": "^8.5.0", | ||
"eslint-config-prettier": "^8.1.0", | ||
"eslint-plugin-flowtype": "^8.0.3", | ||
"eslint-plugin-jest": "^25.3.2", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"eslint-plugin-react": "^7.23.2", | ||
"flow-bin": "^0.111.3", | ||
"gh-pages": "^2.0.1", | ||
"prettier": "1.19.0", | ||
"gh-pages": "^3.2.3", | ||
"jest": "^27.4.5", | ||
"prettier": "^2.2.1", | ||
"react": "^16.2.0", | ||
"react-dom": "^16.2.0", | ||
"webpack": "^4.28.1", | ||
"webpack-cli": "^3.1.2" | ||
"react-test-renderer": "^17.0.1", | ||
"webpack": "^4.46.0", | ||
"webpack-cli": "^3.3.12" | ||
}, | ||
@@ -68,3 +72,9 @@ "browserify": { | ||
] | ||
}, | ||
"jest": { | ||
"testPathIgnorePatterns": [ | ||
"/node_modules/", | ||
"/lib/" | ||
] | ||
} | ||
} |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
27687
481
0
25
6