vuex-orm-decorators
Advanced tools
Comparing version 1.0.8 to 1.1.0
@@ -16,2 +16,3 @@ import { Model } from '@vuex-orm/core'; | ||
return function (target, propertyName) { | ||
console.log(propertyName); | ||
target.constructor._fields = target.constructor._fields || {}; | ||
@@ -18,0 +19,0 @@ target.constructor._fields[propertyName] = fieldType; |
@@ -0,1 +1,2 @@ | ||
import ORMDatabase from './database'; | ||
/** | ||
@@ -9,4 +10,7 @@ * Creates an vuex-orm Model | ||
constructor.entity = entityName; | ||
constructor.baseEntity = parentEntity; | ||
if (parentEntity) { | ||
constructor.baseEntity = parentEntity; | ||
} | ||
constructor.fields = function () { return constructor._fields || {}; }; | ||
ORMDatabase.registerEntity(constructor); | ||
return constructor; | ||
@@ -13,0 +17,0 @@ }; |
{ | ||
"name": "vuex-orm-decorators", | ||
"version": "1.0.8", | ||
"version": "1.1.0", | ||
"description": "Simple Typescript decorators to improve the vuex-orm experience in Typescript by introducing typed property access.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -21,2 +21,3 @@ import { Model, Attribute } from '@vuex-orm/core'; | ||
return (target: Object, propertyName: string | symbol): void => { | ||
console.log(propertyName); | ||
(target.constructor as any)._fields = (target.constructor as any)._fields || {}; | ||
@@ -23,0 +24,0 @@ (target.constructor as any)._fields[propertyName] = fieldType; |
import { Model } from '@vuex-orm/core'; | ||
import ORMDatabase from './database'; | ||
@@ -12,7 +13,9 @@ /** | ||
(constructor as any).entity = entityName; | ||
(constructor as any).baseEntity = parentEntity; | ||
if (parentEntity) { (constructor as any).baseEntity = parentEntity; } | ||
(constructor as any).fields = () => (constructor as any)._fields || {}; | ||
ORMDatabase.registerEntity(constructor as unknown as typeof Model); | ||
return constructor; | ||
}; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32802
21
407