Socket
Socket
Sign inDemoInstall

vuex-orm-decorators

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vuex-orm-decorators - npm Package Compare versions

Comparing version 1.2.5 to 2.0.0-beta.1

.eslintignore

129

dist/attributes.js
import { Model } from '@vuex-orm/core';
/**
* Sets the property as the primary key of the model
*/
export function PrimaryKey() {
return (target, propertyName) => {
target.constructor.primaryKey = propertyName;
};
}
/**
* Adds the property as a model field
* @param fieldType The field attribute
*/
export function Field(fieldType) {
function Field(fieldType) {
return (target, propertyName) => {
const constructor = target.constructor;
if (constructor.entity) {
constructor._fields = constructor.fields() || {};
constructor.fields = () => {
var _a, _b;
const fields = constructor._fields || {};
return Object.assign(Object.assign({}, (_b = (_a = constructor.prototype) === null || _a === void 0 ? void 0 : _a._super) === null || _b === void 0 ? void 0 : _b.fields()), fields);
};
constructor._fields = Object.assign(constructor.fields(), constructor._fields);
if (!fieldType.mutator && fieldType.value === null) {
fieldType.isNullable = true;
}
else {
constructor._fields = constructor._fields || {};
}
constructor._fields[propertyName] = fieldType;
constructor.fields = () => {
return Object.assign({}, constructor._fields);
};
};
}
function nullable(value, defaultValue) {
if (value === null) {
return null;
}
return value === undefined ? defaultValue : value;
}
/**
* Adds the property as a string typed field
* @param defaultValue The default value for the field (if undefined the default will be '')
* @param mutator Mutate the given value
* Adds the property as the `primary key` of the model
*/
export function StringField(defaultValue, mutator) {
return Field(Model.string(defaultValue || '', mutator));
export function PrimaryKey() {
return (target, propertyName) => {
if (propertyName === 'id') {
console.warn('[Vuex ORM Decorators] No need using `PrimaryKey` decorator on property `id`. Property `id` is by default the `primaryKey`.');
}
target.constructor.primaryKey = propertyName;
};
}
/**
* Adds the property as a uid field
* @param value optional function that makes a custom a uid
* Adds the property as a `uid` field
*/

@@ -47,46 +42,33 @@ export function UidField(value) {

/**
* Adds the property as an incremental field
* @deprecated Use `UidField` decorator instead.
* Adds the property as a generic `attribute` field
*/
export function IncrementField() {
return Field(Model.increment());
export function AttrField(value, mutator) {
return Field(Model.attr(nullable(value, ''), mutator));
}
/**
* Adds the property as a generic attribute field
* @param defaultValue The default value for the field (if undefined the default will be '')
* @param mutator Mutate the given value
* Adds the property as a `string` field
*/
export function AttrField(defaultValue, mutator) {
return Field(Model.attr(defaultValue || '', mutator));
export function StringField(value, mutator) {
return Field(Model.string(nullable(value, ''), mutator));
}
/**
* Adds the property as a number typed field
* @param defaultValue The default value for the field (if undefined the default will be 0)
* @param mutator Mutate the given value
* Adds the property as a `number` field
*/
export function NumberField(defaultValue, mutator) {
return Field(Model.number(defaultValue || 0, mutator));
export function NumberField(value, mutator) {
return Field(Model.number(nullable(value, 0), mutator));
}
/**
* Adds the property as a boolean typed field
* @param defaultValue The default value for the field (if undefined the default will be FALSE)
* @param mutator Mutate the given value
* Adds the property as a `boolean` field
*/
export function BooleanField(defaultValue, mutator) {
return Field(Model.boolean(defaultValue || false, mutator));
export function BooleanField(value, mutator) {
return Field(Model.boolean(nullable(value, false), mutator));
}
/**
* Adds the property as a 'Has Many' relationship field
* @param related The class of the related model
* @param foreignKey The foreign key of the related model
* @param localKey The local key on the parent model
* Adds the property as a `boolean` field
*/
export function HasManyField(related, foreignKey, localKey) {
return Field(Model.hasMany(related, foreignKey, localKey));
export function DateField(value, mutator) {
return Field(Model.attr(nullable(value, null), mutator));
}
/**
* Adds the property as a 'Has One' relationship field
* @param related The class of the related model
* @param foreignKey The foreign key of the related model
* @param localKey The local key on the parent model
* Adds the property as a `Has One` relationship field
*/

@@ -97,6 +79,3 @@ export function HasOneField(related, foreignKey, localKey) {

/**
* Adds the property as a 'Belongs To' relationship field
* @param parent The class of the parent model
* @param foreignKey The foreign key of this model
* @param ownerKey The key on the parent model
* Adds the property as a `Belongs To` relationship field
*/

@@ -106,23 +85,53 @@ export function BelongsToField(parent, foreignKey, ownerKey) {

}
/**
* Adds the property as a `Has Many` relationship field
*/
export function HasManyField(related, foreignKey, localKey) {
return Field(Model.hasMany(related, foreignKey, localKey));
}
/**
* Adds the property as a `Has Many By` relationship field
*/
export function HasManyByField(parent, foreignKey, ownerKey) {
return Field(Model.hasManyBy(parent, foreignKey, ownerKey));
}
/**
* Adds the property as a `Has Many Through` relationship field
*/
export function HasManyThroughField(related, through, firstKey, secondKey, localKey, secondLocalKey) {
return Field(Model.hasManyThrough(related, through, firstKey, secondKey, localKey, secondLocalKey));
}
/**
* Adds the property as a `Belongs To Many` relationship field
*/
export function BelongsToManyField(related, pivot, foreignPivotKey, relatedPivotKey, parentKey, relatedKey) {
return Field(Model.belongsToMany(related, pivot, foreignPivotKey, relatedPivotKey, parentKey, relatedKey));
}
/**
* Adds the property as a `Morph To` relationship field
*/
export function MorphToField(id, type) {
return Field(Model.morphTo(id, type));
}
/**
* Adds the property as a `Morph One` relationship field
*/
export function MorphOneField(related, id, type, localKey) {
return Field(Model.morphOne(related, id, type, localKey));
}
/**
* Adds the property as a `Morph Many` relationship field
*/
export function MorphManyField(related, id, type, localKey) {
return Field(Model.morphMany(related, id, type, localKey));
}
/**
* Adds the property as a `Morph To Many` relationship field
*/
export function MorphToManyField(related, pivot, relatedId, id, type, parentKey, relatedKey) {
return Field(Model.morphToMany(related, pivot, relatedId, id, type, parentKey, relatedKey));
}
/**
* Adds the property as a `Morphed By Many` relationship field
*/
export function MorphedByManyField(related, pivot, relatedId, id, type, parentKey, relatedKey) {

@@ -129,0 +138,0 @@ return Field(Model.morphedByMany(related, pivot, relatedId, id, type, parentKey, relatedKey));

@@ -1,11 +0,12 @@

import VuexORM from '@vuex-orm/core';
import { Database, install } from '@vuex-orm/core';
export class ORMDatabase {
static install(options) {
this._models.forEach(model => this._ormDatabase.register(model));
return VuexORM.install(ORMDatabase._ormDatabase, options);
const plugin = install(this._ormDatabase, options);
this._models = [];
return plugin;
}
static registerEntity(model) {
if (this._models.includes(model)) {
console.error(`Unable to register entity '${model.name}'. Entity '${model.name}' is already registered.`);
return;
return console.error(`[Vuex ORM Decorators] Unable to register Model '${model.name}'. Model '${model.name}' is already registered.`);
}

@@ -18,4 +19,4 @@ this._models.push(model);

}
ORMDatabase._ormDatabase = new VuexORM.Database();
ORMDatabase._ormDatabase = new Database();
ORMDatabase._models = [];
//# sourceMappingURL=database.js.map
export { OrmModel } from './model';
export { ORMDatabase } from './database';
export { AttrField, BelongsToField, BelongsToManyField, BooleanField, Field, HasManyByField, HasManyField, HasManyThroughField, HasOneField, IncrementField, MorphManyField, MorphOneField, MorphToField, MorphToManyField, MorphedByManyField, NumberField, PrimaryKey, StringField, UidField } from './attributes';
export { AttrField, BelongsToField, BelongsToManyField, BooleanField, DateField, HasManyByField, HasManyField, HasManyThroughField, HasOneField, MorphedByManyField, MorphManyField, MorphOneField, MorphToField, MorphToManyField, NumberField, PrimaryKey, StringField, UidField, } from './attributes';
//# sourceMappingURL=index.js.map

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

import { ORMDatabase } from './database';
import { ORMDatabase } from '@/database';
export function OrmModel(entity, baseEntity, types) {
return function (constructor) {
return (constructor) => {
// The name that is going be used as module name in Vuex Store.

@@ -10,8 +10,2 @@ constructor.entity = entity;

}
// The definition of the fields of the model and its relations.
constructor.fields = () => {
var _a, _b;
const fields = constructor._fields || {};
return Object.assign(Object.assign({}, (_b = (_a = constructor.prototype) === null || _a === void 0 ? void 0 : _a._super) === null || _b === void 0 ? void 0 : _b.fields()), fields);
};
// The 'types mapping' used to dispatch entities based on their discriminator field.

@@ -18,0 +12,0 @@ if (types && baseEntity) {

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

import { Attribute, Model } from '@vuex-orm/core';
import { Model } from '@vuex-orm/core';
import Mutator from '@vuex-orm/core/lib/attributes/contracts/Mutator';
/**
* Sets the property as the primary key of the model
* Adds the property as the `primary key` of the model
*/
export declare function PrimaryKey(): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as a model field
* @param fieldType The field attribute
* Adds the property as a `uid` field
*/
export declare function Field(fieldType: Attribute): (target: Object, propertyName: string | symbol) => void;
export declare function UidField(value?: () => string | number): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as a string typed field
* @param defaultValue The default value for the field (if undefined the default will be '')
* @param mutator Mutate the given value
* Adds the property as a generic `attribute` field
*/
export declare function StringField(defaultValue?: string | null, mutator?: Mutator<string>): (target: Object, propertyName: string | symbol) => void;
export declare function AttrField(value?: any, mutator?: Mutator<any>): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as a uid field
* @param value optional function that makes a custom a uid
* Adds the property as a `string` field
*/
export declare function UidField(value?: () => string | number): (target: Object, propertyName: string | symbol) => void;
export declare function StringField(value?: string | null, mutator?: Mutator<string>): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as an incremental field
* @deprecated Use `UidField` decorator instead.
* Adds the property as a `number` field
*/
export declare function IncrementField(): (target: Object, propertyName: string | symbol) => void;
export declare function NumberField(value?: number | null, mutator?: Mutator<number>): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as a generic attribute field
* @param defaultValue The default value for the field (if undefined the default will be '')
* @param mutator Mutate the given value
* Adds the property as a `boolean` field
*/
export declare function AttrField(defaultValue?: any, mutator?: Mutator<any>): (target: Object, propertyName: string | symbol) => void;
export declare function BooleanField(value?: boolean | null, mutator?: Mutator<boolean>): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as a number typed field
* @param defaultValue The default value for the field (if undefined the default will be 0)
* @param mutator Mutate the given value
* Adds the property as a `boolean` field
*/
export declare function NumberField(defaultValue?: number | null, mutator?: Mutator<number>): (target: Object, propertyName: string | symbol) => void;
export declare function DateField(value?: Date | string | null, mutator?: Mutator<Date | null>): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as a boolean typed field
* @param defaultValue The default value for the field (if undefined the default will be FALSE)
* @param mutator Mutate the given value
* Adds the property as a `Has One` relationship field
*/
export declare function BooleanField(defaultValue?: boolean | null, mutator?: Mutator<boolean>): (target: Object, propertyName: string | symbol) => void;
export declare function HasOneField(related: typeof Model, foreignKey: string, localKey?: string): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as a 'Has Many' relationship field
* @param related The class of the related model
* @param foreignKey The foreign key of the related model
* @param localKey The local key on the parent model
* Adds the property as a `Belongs To` relationship field
*/
export declare function HasManyField(related: typeof Model | string, foreignKey: string, localKey?: string): (target: Object, propertyName: string | symbol) => void;
export declare function BelongsToField(parent: typeof Model, foreignKey: string, ownerKey?: string): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as a 'Has One' relationship field
* @param related The class of the related model
* @param foreignKey The foreign key of the related model
* @param localKey The local key on the parent model
* Adds the property as a `Has Many` relationship field
*/
export declare function HasOneField(related: typeof Model | string, foreignKey: string, localKey?: string): (target: Object, propertyName: string | symbol) => void;
export declare function HasManyField(related: typeof Model, foreignKey: string, localKey?: string): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as a 'Belongs To' relationship field
* @param parent The class of the parent model
* @param foreignKey The foreign key of this model
* @param ownerKey The key on the parent model
* Adds the property as a `Has Many By` relationship field
*/
export declare function BelongsToField(parent: typeof Model | string, foreignKey: string, ownerKey?: string): (target: Object, propertyName: string | symbol) => void;
export declare function HasManyByField(parent: typeof Model | string, foreignKey: string, ownerKey?: string): (target: Object, propertyName: string | symbol) => void;
export declare function HasManyThroughField(related: typeof Model | string, through: typeof Model | string, firstKey: string, secondKey: string, localKey?: string, secondLocalKey?: string): (target: Object, propertyName: string | symbol) => void;
export declare function BelongsToManyField(related: typeof Model | string, pivot: typeof Model | string, foreignPivotKey: string, relatedPivotKey: string, parentKey?: string, relatedKey?: string): (target: Object, propertyName: string | symbol) => void;
export declare function HasManyByField(parent: typeof Model, foreignKey: string, ownerKey?: string): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as a `Has Many Through` relationship field
*/
export declare function HasManyThroughField(related: typeof Model, through: typeof Model, firstKey: string, secondKey: string, localKey?: string, secondLocalKey?: string): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as a `Belongs To Many` relationship field
*/
export declare function BelongsToManyField(related: typeof Model, pivot: typeof Model, foreignPivotKey: string, relatedPivotKey: string, parentKey?: string, relatedKey?: string): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as a `Morph To` relationship field
*/
export declare function MorphToField(id: string, type: string): (target: Object, propertyName: string | symbol) => void;
export declare function MorphOneField(related: typeof Model | string, id: string, type: string, localKey?: string): (target: Object, propertyName: string | symbol) => void;
export declare function MorphManyField(related: typeof Model | string, id: string, type: string, localKey?: string): (target: Object, propertyName: string | symbol) => void;
export declare function MorphToManyField(related: typeof Model | string, pivot: typeof Model | string, relatedId: string, id: string, type: string, parentKey?: string, relatedKey?: string): (target: Object, propertyName: string | symbol) => void;
export declare function MorphedByManyField(related: typeof Model | string, pivot: typeof Model | string, relatedId: string, id: string, type: string, parentKey?: string, relatedKey?: string): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as a `Morph One` relationship field
*/
export declare function MorphOneField(related: typeof Model, id: string, type: string, localKey?: string): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as a `Morph Many` relationship field
*/
export declare function MorphManyField(related: typeof Model, id: string, type: string, localKey?: string): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as a `Morph To Many` relationship field
*/
export declare function MorphToManyField(related: typeof Model, pivot: typeof Model, relatedId: string, id: string, type: string, parentKey?: string, relatedKey?: string): (target: Object, propertyName: string | symbol) => void;
/**
* Adds the property as a `Morphed By Many` relationship field
*/
export declare function MorphedByManyField(related: typeof Model, pivot: typeof Model, relatedId: string, id: string, type: string, parentKey?: string, relatedKey?: string): (target: Object, propertyName: string | symbol) => void;
import { Model } from '@vuex-orm/core';
import { Options } from '@vuex-orm/core/lib/store/install';
import { Plugin } from 'vuex';
import { Options } from '@vuex-orm/core/lib/store/install';
export declare class ORMDatabase {

@@ -5,0 +5,0 @@ private static _ormDatabase;

export { OrmModel } from './model';
export { ORMDatabase } from './database';
export { AttrField, BelongsToField, BelongsToManyField, BooleanField, Field, HasManyByField, HasManyField, HasManyThroughField, HasOneField, IncrementField, MorphManyField, MorphOneField, MorphToField, MorphToManyField, MorphedByManyField, NumberField, PrimaryKey, StringField, UidField } from './attributes';
export { AttrField, BelongsToField, BelongsToManyField, BooleanField, DateField, HasManyByField, HasManyField, HasManyThroughField, HasOneField, MorphedByManyField, MorphManyField, MorphOneField, MorphToField, MorphToManyField, NumberField, PrimaryKey, StringField, UidField, } from './attributes';
{
"name": "vuex-orm-decorators",
"version": "1.2.5",
"version": "2.0.0-beta.1",
"description": "Simple Typescript decorators to improve the vuex-orm experience in Typescript by introducing typed property access.",

@@ -9,15 +9,14 @@ "main": "dist/index.js",

"scripts": {
"build": "tsc"
"build": "yarn lint && yarn test && tsc --rootDir src",
"lint": "eslint . --ext .ts",
"test": "jest",
"test:coverage": "jest --collect-coverage"
},
"keywords": [
"vue",
"vuex",
"vuex-orm",
"typescript",
"decorators",
"ES2015",
"ES2016",
"ES2017",
"ES2018",
"ES2019",
"ES2020",
"ESNext"
"ES2015"
],

@@ -31,7 +30,21 @@ "repository": {

"devDependencies": {
"@vuex-orm/core": "^0.36.3",
"typescript": "^4.0.3",
"vue": "^2.6.12",
"vuex": "^3.5.1"
"@types/jest": "^26.0",
"@typescript-eslint/eslint-plugin": "^4.12",
"@typescript-eslint/parser": "^4.12",
"@vuex-orm/core": "^0.36",
"eslint": "^7.17",
"eslint-import-resolver-typescript": "^2.3",
"eslint-plugin-import": "^2.22",
"eslint-plugin-promise": "^4.2",
"eslint-plugin-sort-imports-es6-autofix": "^0.5",
"eslint-plugin-sort-keys-fix": "^1.1",
"eslint-plugin-standard": "^5.0",
"eslint-plugin-unused-imports": "^1.0",
"jest": "^26.6",
"ts-jest": "^26.4",
"tslib": "^2.1",
"typescript": "^4.1",
"vue": "^3.0",
"vuex": "^4.0.0-0"
}
}

@@ -152,2 +152,46 @@ # vuex-orm-decorators

### Default Values
If undefined the default values for the `@AttrField`, `@StringField`, `@NumberField`, and `@BooleanField` decorator will be:
```typescript
@OrmModel('users')
class User extends Model {
// Default value: ''
@AttrField() email!: string;
// Default value: ''
@StringField() name!: string;
// Default value: 0
@NumberField() age!: number;
// Default value: false
@BooleanField() active!: boolean;
}
```
If you want to set the field as `nullable`, pass a `null` value as default value, this will also set the `isNullable` Type to `true`:
```typescript
@OrmModel('users')
class User extends Model {
// Default value: null, isNullable: true
@AttrField(null) email!: string;
// Default value: null, isNullable: true
@StringField(null) name!: string;
// Default value: null, isNullable: true
@NumberField(null) age!: number;
// Default value: null, isNullable: true
@BooleanField(null) active!: boolean;
}
```
### Setting a Primary Key

@@ -259,8 +303,2 @@

### ~~Auto Increment~~ (deprecated)
~~To create auto [increment fields](https://vuex-orm.github.io/vuex-orm/guide/model/defining-models.html#auto-increment-type) which use the `@Increment` decorator.~~
**Use `UidField` decorator instead.**
### Primitive Types

@@ -270,5 +308,5 @@

1. `@StringField` creates a [string](https://vuex-orm.github.io/vuex-orm/guide/model/defining-models.html#primitive-types) field
2. `@NumberField` creates a [number](https://vuex-orm.github.io/vuex-orm/guide/model/defining-models.html#primitive-types) field
3. `@BooleanField` creates a [boolean](https://vuex-orm.github.io/vuex-orm/guide/model/defining-models.html#primitive-types) field
* `@StringField` creates a [string](https://vuex-orm.github.io/vuex-orm/guide/model/defining-models.html#primitive-types) field
* `@NumberField` creates a [number](https://vuex-orm.github.io/vuex-orm/guide/model/defining-models.html#primitive-types) field
* `@BooleanField` creates a [boolean](https://vuex-orm.github.io/vuex-orm/guide/model/defining-models.html#primitive-types) field

@@ -279,12 +317,12 @@ ### Creating Relationships

1. `@HasManyField` creates a [HasMany](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#one-to-many) relationship field
2. `@HasOneField` creates a [HasOne](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#one-to-one) relationship field
3. `@BelongsToField` creates an inverse [HasOne](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#one-to-one-inverse) relationship field
4. `@HasManyByField` creates a [HasManyBy](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#has-many-by) relationship field
5. `@HasManyThroughField` creates a [HasManyThrough](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#has-many-through) relationship field
6. `@BelongsToManyField` creates a [BelongsToMany](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#many-to-many) relationship field
7. `@MorphToField` creates a [MorphTo](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#one-to-one-polymorphic) relationship field
8. `@MorphOneField` creates a [MorphOne](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#one-to-one-polymorphic) relationship field
9. `@MorphManyField` creates a [MorphMany](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#one-to-one-polymorphic) relationship field
10. `@MorphToManyField` creates a [MorphToMany](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#many-to-many-polymorphic) relationship field
11. `@MorphedByManyField` creates a [MorphedByMany](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#defining-the-inverse-of-the-relationship-2) relationship field
* `@HasManyField` creates a [HasMany](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#one-to-many) relationship field
* `@HasOneField` creates a [HasOne](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#one-to-one) relationship field
* `@BelongsToField` creates an inverse [HasOne](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#one-to-one-inverse) relationship field
* `@HasManyByField` creates a [HasManyBy](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#has-many-by) relationship field
* `@HasManyThroughField` creates a [HasManyThrough](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#has-many-through) relationship field
* `@BelongsToManyField` creates a [BelongsToMany](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#many-to-many) relationship field
* `@MorphToField` creates a [MorphTo](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#one-to-one-polymorphic) relationship field
* `@MorphOneField` creates a [MorphOne](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#one-to-one-polymorphic) relationship field
* `@MorphManyField` creates a [MorphMany](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#one-to-one-polymorphic) relationship field
* `@MorphToManyField` creates a [MorphToMany](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#many-to-many-polymorphic) relationship field
* `@MorphedByManyField` creates a [MorphedByMany](https://vuex-orm.github.io/vuex-orm/guide/model/relationships.html#defining-the-inverse-of-the-relationship-2) relationship field

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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