Socket
Socket
Sign inDemoInstall

vue-class-component

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-class-component - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

test/test.build.js

70

index.js

@@ -18,37 +18,47 @@ var Vue = require('vue')

function decorator (options) {
return function (Component) {
options.name = options.name || Component.name
// prototype props.
var proto = Component.prototype
Object.getOwnPropertyNames(proto).forEach(function (key) {
if (key === 'constructor') {
return
function componentFactory (Component, options) {
if (!options) {
options = {}
}
options.name = options.name || Component.name
// prototype props.
var proto = Component.prototype
Object.getOwnPropertyNames(proto).forEach(function (key) {
if (key === 'constructor') {
return
}
// hooks
if (internalHooks.indexOf(key) > -1) {
options[key] = proto[key]
return
}
var descriptor = Object.getOwnPropertyDescriptor(proto, key)
if (typeof descriptor.value === 'function') {
// methods
(options.methods || (options.methods = {}))[key] = descriptor.value
} else if (descriptor.get || descriptor.set) {
// computed properties
(options.computed || (options.computed = {}))[key] = {
get: descriptor.get,
set: descriptor.set
}
// hooks
if (internalHooks.indexOf(key) > -1) {
options[key] = proto[key]
return
}
var descriptor = Object.getOwnPropertyDescriptor(proto, key)
if (typeof descriptor.value === 'function') {
// methods
(options.methods || (options.methods = {}))[key] = descriptor.value
} else if (descriptor.get || descriptor.set) {
// computed properties
(options.computed || (options.computed = {}))[key] = {
get: descriptor.get,
set: descriptor.set
}
}
})
// find super
var Super = proto.__proto__.constructor
if (!(Super instanceof Vue)) {
Super = Vue
}
return Super.extend(options)
})
// find super
var Super = proto.__proto__.constructor
if (!(Super instanceof Vue)) {
Super = Vue
}
return Super.extend(options)
}
function decorator (options) {
if (typeof options === 'function') {
return componentFactory(options)
}
return function (Component) {
return componentFactory(Component, options)
}
}
module.exports = decorator
{
"name": "vue-class-component",
"version": "3.0.0",
"version": "3.1.0",
"description": "ES201X/TypeScript class decorator for Vue components",

@@ -8,3 +8,4 @@ "main": "index.js",

"build": "webpack --config example/webpack.config.js",
"dev": "webpack --config example/webpack.config.js --watch"
"dev": "webpack --config example/webpack.config.js --watch",
"test": "webpack --config test/webpack.config.js && mocha test/test.build.js"
},

@@ -28,8 +29,10 @@ "repository": {

"devDependencies": {
"babel-core": "^5.6.7",
"babel-loader": "^5.2.0",
"node-libs-browser": "^0.5.2",
"vue": "^1.0.4",
"webpack": "^1.9.12"
"babel-core": "^5.8.0",
"babel-loader": "^5.3.3",
"chai": "^3.5.0",
"mocha": "^2.4.5",
"node-libs-browser": "^1.0.0",
"vue": "^1.0.16",
"webpack": "^1.12.12"
}
}
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