New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aj-captcha-react

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aj-captcha-react - npm Package Compare versions

Comparing version 1.0.7 to 1.1.0

es/hooks/index.d.ts

66

es/captcha/demo/index.js

@@ -0,6 +1,28 @@

function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
import React, { useRef } from 'react';
import { Captcha } from 'aj-captcha-react';
import { Captcha, useCaptcha } from 'aj-captcha-react';
export default (function () {
var ref = useRef();
var _useCaptcha = useCaptcha({
path: 'https://api.ejiexi.com/system/cgi'
}),
_useCaptcha2 = _slicedToArray(_useCaptcha, 1),
run = _useCaptcha2[0];
var click = function click() {

@@ -26,6 +48,44 @@ var _ref$current;

height: '50px',
lineHeight: '50p',
lineHeight: '50px',
background: '#1890ff'
}
}, "\u70B9\u51FB"));
}, "\u70B9\u51FB"), /*#__PURE__*/React.createElement("button", {
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
var data;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.prev = 0;
_context.next = 3;
return run();
case 3:
data = _context.sent;
console.log(data);
_context.next = 10;
break;
case 7:
_context.prev = 7;
_context.t0 = _context["catch"](0);
console.log(_context.t0);
case 10:
case "end":
return _context.stop();
}
}
}, _callee, null, [[0, 7]]);
})),
style: {
border: 'none',
color: '#fff',
width: '100px',
height: '50px',
marginLeft: '10px',
lineHeight: '50px',
background: '#1890ff'
}
}, "hook"));
});

@@ -7,1 +7,2 @@ export { default as Captcha } from './captcha';

export { default as Points } from './points';
export * from './hooks';

3

es/index.js

@@ -6,2 +6,3 @@ export { default as Captcha } from './captcha';

export { default as Slider } from './slider';
export { default as Points } from './points';
export { default as Points } from './points';
export * from './hooks';

@@ -18,5 +18,27 @@ "use strict";

function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var _default = function _default() {
var ref = (0, _react.useRef)();
var _useCaptcha = (0, _ajCaptchaReact.useCaptcha)({
path: 'https://api.ejiexi.com/system/cgi'
}),
_useCaptcha2 = _slicedToArray(_useCaptcha, 1),
run = _useCaptcha2[0];
var click = function click() {

@@ -42,8 +64,46 @@ var _ref$current;

height: '50px',
lineHeight: '50p',
lineHeight: '50px',
background: '#1890ff'
}
}, "\u70B9\u51FB"));
}, "\u70B9\u51FB"), /*#__PURE__*/_react.default.createElement("button", {
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
var data;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.prev = 0;
_context.next = 3;
return run();
case 3:
data = _context.sent;
console.log(data);
_context.next = 10;
break;
case 7:
_context.prev = 7;
_context.t0 = _context["catch"](0);
console.log(_context.t0);
case 10:
case "end":
return _context.stop();
}
}
}, _callee, null, [[0, 7]]);
})),
style: {
border: 'none',
color: '#fff',
width: '100px',
height: '50px',
marginLeft: '10px',
lineHeight: '50px',
background: '#1890ff'
}
}, "hook"));
};
exports.default = _default;

@@ -7,1 +7,2 @@ export { default as Captcha } from './captcha';

export { default as Points } from './points';
export * from './hooks';

@@ -6,2 +6,10 @@ "use strict";

});
var _exportNames = {
Captcha: true,
Popup: true,
Icon: true,
Loading: true,
Slider: true,
Points: true
};
Object.defineProperty(exports, "Captcha", {

@@ -56,2 +64,16 @@ enumerable: true,

var _hooks = require("./hooks");
Object.keys(_hooks).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _hooks[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _hooks[key];
}
});
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -10,3 +10,3 @@ {

],
"version": "1.0.7",
"version": "1.1.0",
"authors": {

@@ -35,2 +35,3 @@ "name": "yanganfu",

"react": "^17.0.2",
"react-dom": "^17.0.2",
"umi-request": "^1.4.0"

@@ -37,0 +38,0 @@ },

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