]> Lady’s Gitweb - Etiquette/commit
Use configurable metadata for model
authorLady <redacted>
Wed, 14 Jun 2023 02:48:09 +0000 (19:48 -0700)
committerLady <redacted>
Wed, 14 Jun 2023 05:00:30 +0000 (22:00 -0700)
commite20983aca1b36dd368d52e02ee018c2eaf0ca55f
tree01d3e3d07038490ae2ee6c083ce7b5a036b16c52
parent771a1ca8d8302b01060db00de7f588093e8805ec
Use configurable metadata for model

Instead of hardcoding properties and methods, use a schema to generate
them. This makes the code significantly dry·er at the cost of some
slightly obtuse metaprogramming.

The schema format is somewhat minimal and makes some assumptions; this
is not intended as a generalist O·W·L processor or anything of the
sort.

Previously, `TagSystem::Tag` returned a bound class constructor. With
this commit, it instead returns a (manually‐defined) constructor
function which effectively does the partial application in its function
body. Each constructor has its own unique prototype object (inheriting
from `Tag.prototype`) and its own static methods (bound forms of `Tag`
static methods). Constructors themselves inherit from
`Function.prototype` (for now).
model.js
model.test.js
schema.js [new file with mode: 0644]
This page took 0.050552 seconds and 4 git commands to generate.