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

vue-turnstile

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-turnstile - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

45

dist/vue-turnstile.js

@@ -1,5 +0,5 @@

import { defineComponent as u, openBlock as l, createElementBlock as d } from "vue";
const c = "https://challenges.cloudflare.com/turnstile/v0/api.js", o = "cfTurnstileOnLoad";
let n = typeof window < "u" && window.turnstile !== void 0 ? "ready" : "unloaded", s;
const p = u({
import { defineComponent as a, openBlock as u, createElementBlock as l } from "vue";
const c = "https://challenges.cloudflare.com/turnstile/v0/api.js", d = "cfTurnstileOnLoad";
let i = typeof window < "u" && window.turnstile !== void 0 ? "ready" : "unloaded", s;
const p = a({
name: "VueTurnstile",

@@ -49,3 +49,4 @@ emits: ["update:modelValue"],

return {
resetTimeout: void 0
resetTimeout: void 0,
widgetId: void 0
};

@@ -72,4 +73,7 @@ },

},
remove() {
this.widgetId && (window.turnstile.remove(this.widgetId), this.widgetId = void 0);
},
render() {
window.turnstile.render(this.$refs.turnstile, this.turnstileOptions);
this.widgetId = window.turnstile.render(this.$refs.turnstile, this.turnstileOptions);
},

@@ -84,10 +88,10 @@ startResetTimeout() {

const r = new Promise((t, e) => {
s = { resolve: t, reject: e }, n === "ready" && t(void 0);
s = { resolve: t, reject: e }, i === "ready" && t(void 0);
});
window[o] = () => {
s.resolve(), n = "ready";
window[d] = () => {
s.resolve(), i = "ready";
}, await (() => {
if (n === "unloaded") {
n = "loading";
const t = `${c}?onload=${o}&render=explicit`, e = document.createElement("script");
if (i === "unloaded") {
i = "loading";
const t = `${c}?onload=${d}&render=explicit`, e = document.createElement("script");
e.src = t, e.async = !0, e.addEventListener("error", () => {

@@ -99,15 +103,18 @@ s.reject("Failed to load Turnstile.");

})(), this.renderOnMount && this.render();
},
beforeUnmount() {
this.remove(), clearTimeout(this.resetTimeout);
}
}), m = (r, i) => {
}), m = (r, n) => {
const t = r.__vccOpts || r;
for (const [e, a] of i)
t[e] = a;
for (const [e, o] of n)
t[e] = o;
return t;
}, f = { ref: "turnstile" };
function h(r, i, t, e, a, y) {
return l(), d("div", f, null, 512);
function h(r, n, t, e, o, w) {
return u(), l("div", f, null, 512);
}
const _ = /* @__PURE__ */ m(p, [["render", h]]);
const v = /* @__PURE__ */ m(p, [["render", h]]);
export {
_ as default
v as default
};

@@ -11,2 +11,3 @@ import type { PropType } from 'vue';

resetTimeout?: ReturnType<typeof setTimeout>;
widgetId?: string;
}

@@ -64,2 +65,3 @@ declare const _default: import("vue").DefineComponent<{

reset(): void;
remove(): void;
render(): void;

@@ -66,0 +68,0 @@ startResetTimeout(): void;

{
"name": "vue-turnstile",
"version": "1.0.3",
"version": "1.0.4",
"description": "Vue library for Cloudflare Turnstile CAPTCHA alternative",

@@ -5,0 +5,0 @@ "type": "module",

Sorry, the diff of this file is not supported yet

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