Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/cotton/src/utils/models.ts>mapValueProperties

SQL Database Toolkit for Deno
Latest
function mapValueProperties
import { mapValueProperties } from "https://deno.land/x/cotton@v0.7.5/src/utils/models.ts";

Map values from getValues to be compatible with model properties vice versa.

Parameters

modelClass: Function

the model class of those values.

values: ModelDatabaseValues

the model values.

to: "propertyKey" | "name"

the property naming convention you want to convert.

Returns

ModelDatabaseValues