ViewModelFieldPaths

Source
import { ViewModelFieldPaths } from "@prestojs/viewmodel";

Stores the field paths for a model in a standardised form for use in caching.

API

new ViewModelFieldPaths(modelClass,flattenedPath)

Source
ParameterTypeDescription
*modelClassViewModel Class
*flattenedPathstring[]

Methods

Is the specified paths a subset of this?

ParameterTypeDescription
*pathsViewModelFieldPaths
*ignoreNestedboolean
boolean

Properties

The expanded paths - any nested fields are represented as an array

The flattened path - any nested fields are joined with '.'

A key representation of this field path that can be used as a cache key

Names of fields that aren't relations

Map of relation field name to the paths for that relation