Skip to content

Commit b7bd2b8

Browse files
authored
BREAKING CHANGE: fixes the inversion of meta-timestamps (#15)
1 parent 1d1967a commit b7bd2b8

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/emitter.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,10 @@ function emitAttribute(ctx: EmitContext, prop: ModelProperty): Attribute {
127127
if (ctx.program.stateMap(StateKeys.updatedAt).has(prop)) {
128128
assert(type.type === "number", "createdAt must be a number");
129129

130-
const label = ctx.program.stateMap(StateKeys.updatedAt).get(prop);
131-
132130
return {
133131
...type,
134132
type: "number",
135-
label,
136-
readOnly: true,
133+
watch: "*",
137134
required: true,
138135
default: () => Date.now(),
139136
set: () => Date.now(),
@@ -143,13 +140,10 @@ function emitAttribute(ctx: EmitContext, prop: ModelProperty): Attribute {
143140
if (ctx.program.stateMap(StateKeys.createdAt).has(prop)) {
144141
assert(type.type === "number", "createdAt must be a number");
145142

146-
const label = ctx.program.stateMap(StateKeys.createdAt).get(prop);
147-
148143
return {
149144
...type,
150145
type: "number",
151-
label,
152-
watch: "*",
146+
readOnly: true,
153147
required: true,
154148
default: () => Date.now(),
155149
set: () => Date.now(),

0 commit comments

Comments
 (0)