Socket
Socket
Sign inDemoInstall

vue-honeypot

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 3.0.0

232

dist/index.esm.js

@@ -1,188 +0,58 @@

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var script = {
data: () => ({
value: ''
}),
import { openBlock as d, createElementBlock as p, withDirectives as u, createElementVNode as s, vModelText as c } from "vue";
const f = (e, t) => {
const o = e.__vccOpts || e;
for (const [a, i] of t)
o[a] = i;
return o;
}, h = {
data: () => ({ value: "" }),
methods: {
validate() {
if (this.value) {
throw new Error('Looks like you are a bot. You have filled out the legendary honeypot field!');
}
if (this.value)
throw new Error(
"Looks like you are a bot. You have filled out the legendary honeypot field!"
);
}
}
};
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
if (typeof shadowMode !== 'boolean') {
createInjectorSSR = createInjector;
createInjector = shadowMode;
shadowMode = false;
}
// Vue.extend constructor export interop.
const options = typeof script === 'function' ? script.options : script;
// render functions
if (template && template.render) {
options.render = template.render;
options.staticRenderFns = template.staticRenderFns;
options._compiled = true;
// functional template
if (isFunctionalTemplate) {
options.functional = true;
}
}
// scopedId
if (scopeId) {
options._scopeId = scopeId;
}
let hook;
if (moduleIdentifier) {
// server build
hook = function (context) {
// 2.3 injection
context =
context || // cached call
(this.$vnode && this.$vnode.ssrContext) || // stateful
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
// 2.2 with runInNewContext: true
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
context = __VUE_SSR_CONTEXT__;
}
// inject component styles
if (style) {
style.call(this, createInjectorSSR(context));
}
// register component module identifier for async chunk inference
if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier);
}
};
// used by ssr in case component is cached and beforeCreate
// never gets called
options._ssrRegister = hook;
}
else if (style) {
hook = shadowMode
? function (context) {
style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
}
: function (context) {
style.call(this, createInjector(context));
};
}
if (hook) {
if (options.functional) {
// register for functional component in vue file
const originalRender = options.render;
options.render = function renderWithStyleInjection(h, context) {
hook.call(context);
return originalRender(h, context);
};
}
else {
// inject component registration as beforeCreate hook
const existing = options.beforeCreate;
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
}
}
return script;
}, m = { style: {
position: "absolute",
top: 0,
left: 0,
zIndex: -1,
width: 0,
height: 0,
opacity: 0
} }, v = /* @__PURE__ */ s(
"span",
null,
"Name",
-1
/* HOISTED */
);
function y(e, t, o, a, i, _) {
return d(), p("label", m, [
v,
u(s(
"input",
{
"onUpdate:modelValue": t[0] || (t[0] = (r) => e.value = r),
autocomplete: "off",
tabindex: "-1",
type: "text"
},
null,
512
/* NEED_PATCH */
), [
[c, e.value]
])
]);
}
/* script */
const __vue_script__ = script;
/* template */
var __vue_render__ = function () {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c('label', {
staticStyle: {
"position": "absolute",
"top": "0",
"left": "0",
"z-index": "-1",
"width": "0",
"height": "0",
"opacity": "0"
}
}, [_c('span', [_vm._v("Name")]), _vm._v(" "), _c('input', {
directives: [{
name: "model",
rawName: "v-model",
value: _vm.value,
expression: "value"
}],
attrs: {
"autocomplete": "off",
"tabindex": "-1",
"type": "text"
},
domProps: {
"value": _vm.value
},
on: {
"input": function ($event) {
if ($event.target.composing) {
return;
}
_vm.value = $event.target.value;
}
}
})]);
const l = /* @__PURE__ */ f(h, [["render", y]]), n = (e) => {
n.installed || (n.installed = !0, e.component("VueHoneypot", l));
};
var __vue_staticRenderFns__ = [];
/* style */
const __vue_inject_styles__ = undefined;
/* scoped */
const __vue_scope_id__ = undefined;
/* module identifier */
const __vue_module_identifier__ = undefined;
/* functional template */
const __vue_is_functional_template__ = false;
/* style inject */
/* style inject SSR */
/* style inject shadow dom */
const __vue_component__ = /*#__PURE__*/normalizeComponent({
render: __vue_render__,
staticRenderFns: __vue_staticRenderFns__
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
// Import vue component
// install function executed by Vue.use()
const install = function installVueIcon(Vue) {
if (install.installed) return;
install.installed = true;
Vue.component('VueHoneypot', __vue_component__);
l.install = n;
typeof window < "u" && (window.VueHoneypot = l);
export {
l as default
};
// Inject install function into component - allows component
// to be registered via Vue.use() as well as Vue.component()
__vue_component__.install = install;
// It's possible to expose named exports when writing components that can
// also be used as directives, etc. - eg. import { RollupDemoDirective } from 'rollup-demo';
// export const RollupDemoDirective = component;
export { __vue_component__ as default };

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

!function(e){"use strict";function t(e,t,n,o,i,a,s,l,d,r){"boolean"!=typeof s&&(d=l,l=s,s=!1);const u="function"==typeof n?n.options:n;let c;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,i&&(u.functional=!0)),o&&(u._scopeId=o),a?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=c):t&&(c=s?function(e){t.call(this,r(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,l(e))}),c)if(u.functional){const e=u.render;u.render=function(t,n){return c.call(n),e(t,n)}}else{const e=u.beforeCreate;u.beforeCreate=e?[].concat(e,c):[c]}return n}const n=t({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("label",{staticStyle:{position:"absolute",top:"0",left:"0","z-index":"-1",width:"0",height:"0",opacity:"0"}},[n("span",[e._v("Name")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"value"}],attrs:{autocomplete:"off",tabindex:"-1",type:"text"},domProps:{value:e.value},on:{input:function(t){t.target.composing||(e.value=t.target.value)}}})])},staticRenderFns:[]},undefined,{data:()=>({value:""}),methods:{validate(){if(this.value)throw new Error("Looks like you are a bot. You have filled out the legendary honeypot field!")}}},undefined,false,undefined,!1,void 0,void 0,void 0),o=function(e){o.installed||(o.installed=!0,e.component("VueHoneypot",n))},i={install:o};{let e=null;"undefined"!=typeof window?e=window.Vue:"undefined"!=typeof global&&(e=global.Vue),e&&e.use(i)}n.install=o,e.default=n,Object.defineProperty(e,"__esModule",{value:!0})}({});
var Lib=function(t){"use strict";const r=(e,n)=>{const a=e.__vccOpts||e;for(const[i,s]of n)a[i]=s;return a},d={data:()=>({value:""}),methods:{validate(){if(this.value)throw new Error("Looks like you are a bot. You have filled out the legendary honeypot field!")}}},c={style:{position:"absolute",top:0,left:0,zIndex:-1,width:0,height:0,opacity:0}},p=t.createElementVNode("span",null,"Name",-1);function u(e,n,a,i,s,h){return t.openBlock(),t.createElementBlock("label",c,[p,t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=f=>e.value=f),autocomplete:"off",tabindex:"-1",type:"text"},null,512),[[t.vModelText,e.value]])])}const o=r(d,[["render",u]]),l=e=>{l.installed||(l.installed=!0,e.component("VueHoneypot",o))};return o.install=l,typeof window<"u"&&(window.VueHoneypot=o),o}(Vue);
{
"name": "vue-honeypot",
"version": "2.0.0",
"version": "3.0.0",
"description": "A simple honeypot component for Vue.js.",

@@ -20,6 +20,6 @@ "keywords": [

"type": "module",
"main": "dist/index.ssr.js",
"exports": "./dist/index.esm.js",
"main": "dist/index.esm.js",
"unpkg": "dist/index.min.js",
"module": "dist/index.esm.js",
"browser": "dist/index.esm.js",
"browser": "dist/index.min.js",
"files": [

@@ -38,7 +38,17 @@ "dist"

"devDependencies": {
"@dword-design/base": "^9.2.0",
"@dword-design/base-config-component": "^1.1.35"
"@dword-design/base": "^10.0.5",
"@dword-design/base-config-component": "^3.0.3",
"@dword-design/functions": "^5.0.20",
"@dword-design/puppeteer": "^6.0.10",
"@dword-design/tester": "^2.0.19",
"@dword-design/tester-plugin-puppeteer": "^2.1.68",
"@dword-design/tester-plugin-tmp-dir": "^2.1.26",
"execa": "^7.1.1",
"fs-extra": "^11.1.1",
"nuxt": "^3.5.3",
"nuxt-dev-ready": "^2.0.1",
"tree-kill-promise": "^3.0.14"
},
"engines": {
"node": ">=14"
"node": ">=16"
},

@@ -45,0 +55,0 @@ "publishConfig": {

@@ -94,6 +94,5 @@ <!-- TITLE/ -->

```js
import Vue from 'vue'
import VueHoneypot from 'vue-honeypot'
Vue.component('VueHoneypot', VueHoneypot)
app.component('VueHoneypot', VueHoneypot)
```

@@ -104,6 +103,5 @@

```js
import Vue from 'vue'
import VueHoneypot from 'vue-honeypot'
Vue.use(VueHoneypot)
app.use(VueHoneypot)
```

@@ -114,3 +112,3 @@

```html
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script src="https://unpkg.com/vue-honeypot"></script>

@@ -117,0 +115,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc