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

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

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

Transform an array of plain JavaScript objects to multiple Model classes.

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]