ViewModelFieldPaths
Sourceimport { ViewModelFieldPaths } from "@prestojs/viewmodel";
Stores the field paths for a model in a standardised form for use in caching.
API
Constructor
new ViewModelFieldPaths(modelClass,flattenedPath)
SourceParameter | Type | Description | |
---|---|---|---|
* | modelClass | ViewModel Class | |
* | flattenedPath | string[] |
Methods
isSubset(paths,ignoreNested)
SourceIs the specified paths
a subset of this?
Parameter | Type | Description | |
---|---|---|---|
* | paths | ViewModelFieldPaths | |
* | ignoreNested | boolean |
Returns
Properties
fieldPaths: FieldPath[]
The expanded paths - any nested fields are represented as an array
flattenedPath: string[]
The flattened path - any nested fields are joined with '.'
key: string
A key representation of this field path that can be used as a cache key
modelClass: ViewModel Class
nonRelationFieldNames: string[]
Names of fields that aren't relations
relations: Record
Map of relation field name to the paths for that relation