2022-08-27 17:46:43 +00:00
|
|
|
import * as RSRecord from "../rescript/ForTS/ForTS_SquiggleValue/ForTS_SquiggleValue_Record.gen";
|
2022-08-28 16:19:44 +00:00
|
|
|
import { wrapValue } from "./SqValue";
|
2022-08-29 21:51:44 +00:00
|
|
|
import { SqValueLocation } from "./SqValueLocation";
|
2022-08-27 17:46:43 +00:00
|
|
|
|
|
|
|
type T = RSRecord.squiggleValue_Record;
|
|
|
|
|
2022-08-28 16:19:44 +00:00
|
|
|
export class SqRecord {
|
2022-08-29 21:51:44 +00:00
|
|
|
constructor(private _value: T, public location: SqValueLocation) {}
|
2022-08-27 17:46:43 +00:00
|
|
|
|
|
|
|
entries() {
|
|
|
|
return RSRecord.getKeyValuePairs(this._value).map(
|
2022-08-29 21:51:44 +00:00
|
|
|
([k, v]) => [k, wrapValue(v, this.location.extend(k))] as const
|
2022-08-27 17:46:43 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|