Socket
Socket
Sign inDemoInstall

vue-property-decorator

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-property-decorator - npm Package Compare versions

Comparing version 7.1.1 to 7.2.0

2

lib/vue-property-decorator.d.ts

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

/** vue-property-decorator verson 7.1.1 MIT LICENSE copyright 2018 kaorun343 */
/** vue-property-decorator verson 7.2.0 MIT LICENSE copyright 2018 kaorun343 */
import Vue, { PropOptions, WatchOptions } from 'vue';

@@ -3,0 +3,0 @@ import Component, { mixins } from 'vue-class-component';

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

/** vue-property-decorator verson 7.1.1 MIT LICENSE copyright 2018 kaorun343 */
/** vue-property-decorator verson 7.2.0 MIT LICENSE copyright 2018 kaorun343 */
'use strict';

@@ -91,6 +91,7 @@ import Vue from 'vue';

export function Emit(event) {
return function (target, key, descriptor) {
return function (_target, key, descriptor) {
key = hyphenate(key);
var original = descriptor.value;
descriptor.value = function emitter() {
var _this = this;
var args = [];

@@ -100,8 +101,21 @@ for (var _i = 0; _i < arguments.length; _i++) {

}
var emit = function (returnValue) {
if (returnValue !== undefined)
args.unshift(returnValue);
_this.$emit.apply(_this, [event || key].concat(args));
};
var returnValue = original.apply(this, args);
if (returnValue !== undefined)
args.unshift(returnValue);
this.$emit.apply(this, [event || key].concat(args));
if (isPromise(returnValue)) {
returnValue.then(function (returnValue) {
emit(returnValue);
});
}
else {
emit(returnValue);
}
};
};
}
function isPromise(obj) {
return obj instanceof Promise || (obj && typeof obj.then === 'function');
}

@@ -10,3 +10,3 @@ (function (global, factory) {

/** vue-property-decorator verson 7.1.1 MIT LICENSE copyright 2018 kaorun343 */
/** vue-property-decorator verson 7.2.0 MIT LICENSE copyright 2018 kaorun343 */
'use strict';

@@ -98,6 +98,7 @@ /**

function Emit(event) {
return function (target, key, descriptor) {
return function (_target, key, descriptor) {
key = hyphenate(key);
var original = descriptor.value;
descriptor.value = function emitter() {
var _this = this;
var args = [];

@@ -107,9 +108,22 @@ for (var _i = 0; _i < arguments.length; _i++) {

}
var emit = function (returnValue) {
if (returnValue !== undefined)
args.unshift(returnValue);
_this.$emit.apply(_this, [event || key].concat(args));
};
var returnValue = original.apply(this, args);
if (returnValue !== undefined)
args.unshift(returnValue);
this.$emit.apply(this, [event || key].concat(args));
if (isPromise(returnValue)) {
returnValue.then(function (returnValue) {
emit(returnValue);
});
}
else {
emit(returnValue);
}
};
};
}
function isPromise(obj) {
return obj instanceof Promise || (obj && typeof obj.then === 'function');
}

@@ -116,0 +130,0 @@ exports.Component = vueClassComponent__default;

{
"name": "vue-property-decorator",
"version": "7.1.1",
"version": "7.2.0",
"description": "property decorators for Vue Component",

@@ -18,4 +18,3 @@ "main": "lib/vue-property-decorator.umd.js",

"scripts": {
"build": "tsc -p src/tsconfig.json",
"build:umd": "rollup -c",
"build": "tsc -p src/tsconfig.json && rollup -c",
"test": "webpack --config ./test/webpack.config.js && ava test/decorator.spec.js"

@@ -22,0 +21,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