Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

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

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

Transform single plain JavaScript object to Model class.

Parameters

modelClass: { new (): T; }

The model class which all the data will be transformed into

data: ModelValues

A plain JavaScript object that holds the model data

optional
fromDatabase: boolean = [UNSUPPORTED]

Check whether the data is saved to the database or not